Dwengo Posted March 9, 2018 Share Posted March 9, 2018 I feel like this is an issue that must have been solved and is a simple algorithm, but I'm struggling to figure it out myself.. https://playground.babylonjs.com/#6R8BFY#11 The problem I'm having is that if I click on the ground (so that the mesh moves towards it). If the destination point is not perfectly diagonal or straight, then the x axis or the z axis is reached first. It kind of goes diagonally for a bit before going straight for the rest of the route. The code is really simple, And my feeling is the movement logic needs improving. I'm essentially applying a force of 1 or -1 on each axis depending on where the mesh is currently until it reaches its point. Is there a better way to do this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.