Using velocity to move one object towards another.
#2
This is adapted from my gravity tool script. It hasn't been tested.

[lua]
force = 5
unitVector = box1.PositionConfusedub(box2).normalized --Get a vector with length 1 that points in the right direction
box1.FixedVelocity.Velocity = unitVector:mul(force) --Multiply it by the force to get the new velocity
[/lua]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)