I’ll need some time to study and fully understand this code, but the mesh is moving correctly.
There’s one other element that I can’t seem to figure out. Any suggestions for how to get sphere2 (the grey one) to follow the moving sphere around the map?
Example:
Based on the grey sphere’s speed, it will be able to follow and eventually collide with the textured sphere, or it will just continue to try to move to the textured sphere’s current XYZ position if its speed is too low.
That depends on how you want it to behave. There are multiply ways of achieving that.
You can use the direction between the two meshes, you can interpolate between the positions, you can rotate the grey sphere toward the other one and use the local forward axis like above. It’s a matter of what’s needed in the end. This is probably the easiest way: https://www.babylonjs-playground.com/#GRXDS7#2