Entity.lookAt not working as excepted

I have an entity with a cylinder model in worldspace and want it’s it’s local Y vector to point towards 0, 0, 0.

The cylinders default orientation (rotation 0, 0, 0) is vertical with the pivot at the bottom, z is forward, y is up, x is right.

Yet entitiy.lookAt(0, 0, 0); or using any other up axis never works and never seems to rotate around the x-axis.

Am I doing something wrong?

lookAt points the the negative Z (forward) axis towards the point that is passed a as param.

So in your case, you are pointing the negative Z axis of the entity to world 0,0,0

Ah that makes sense, I solved it by parenting it in another entity. Thanks!

1 Like