Set an objects velocity towards a point

Hello mates, I am trying to do something really simple, but it seems that I am simpler…
I am trying to set an objects velocity (Using a rigid body control) to go towards a point, but I have had no luck. I have tried messing with the setlinearvelocity method in multiple ways, and have browsed the vector math slides until the comic sans became imprinted into my brain, but to no effect. I am sure this is a simple issue, but I have been grappling with it for days before giving up and displaying my idiocy on here instead. Any help would be appreciated!

[java]
Vector3f vecFromOriginToA = aSpatial.getWorldTranslation();
Vector3f vecFromOriginToB = bSpatial.getWorldTranslation();

vecFromAToB = vecFromOriginToB.subtract(vecFromOriginToA);
[/java]

If you set the linear velocity of A to vecFromAToB, it moves to B.

1 Like