04-05-2011, 01:36 AM
(This post was last modified: 04-05-2011, 01:36 AM by Jacob__mybb_import1.)
This is adapted from my gravity tool script. It hasn't been tested.
[lua]
force = 5
unitVector = box1.Positionub(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]
[lua]
force = 5
unitVector = box1.Positionub(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]