Quaternion rotation breaks position

Hi all!

The goal is when you click on the ground the capsule will move to that position and rotate, the sphere in front is how you tell which way it’s facing.

Here is the playground to see that https://playground.babylonjs.com/#3EF8TZ#1

As soon as I add an imposter to the capsule, uncomment line 30, the capsule will move to the position of the click but it isn’t rotating. So to rotate it I added line 73, you’ll need to comment 72 and uncomment 73, and the capsule will rotate towards the click but won’t move to it.

I have no idea why the position isnt working when using the quaternion to rotate. I could really use some help. Thanks!

Hello and welcome to the Babylon community! I’ll tag our physics guy @Cedric

1 Like

Once physics is enable with an impostor, rotationQuaternion is initialized and used. rotation still exists but is unused.
You did half of it with Quaternion.FromEulerAngles but you used it with wrong property.

2 Likes