![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Deith |
The issue I’m having is that when I use look_at(player.global_transform.origin, Vector3.UP)
on the NPC I’m trying to rotate towards player the result is that the NPC is rotating, but it’s not rotating to look exactly at the player, it’s like it’s 90 degrees off. Like this And after looking up documentation and tutorial it seems that maybe it’s my scene and meshes are wrong. Both player and NPC have all transform.rotations set to 0 on y. In the viewport they look to the right (the nose is a child node of the body mesh instance)
player viewport: https://imgur.com/B6cBzCR
ncp viewport: https://imgur.com/ZjMXO8G
And I’m calling look_at on the whole NPC scene, not just mesh instance.
So what am I doing wrong? Cause everywhere look_at seems to just work in 3D, but for me it doesn’t work at all.
So I rotated just the mesh, not spatial parent node of NPC by 90 degrees on Y and now it works - like this https://imgur.com/SDxh3WF but I still don’t understand why I had to and why it worked. It will be kinda awkward to have the mesh look away in the NPC scene when the model is replaced.
Deith | 2022-10-13 15:32