[Solved] GetWorldRotation question

Hello (and pls sorry for my English)! I want to make a system: when player holding the right mouse button and moves the mouse, the camera rotates left or right depending on the mouse direction. This script works perfectly well, but the editor keeps writing in the console that I should use GetWorldRotation instead of GetRotationZ. I tried to replace GetRotationZ with GetWorldRotation and this doesn’t work.

Why it is not recommended to use RotationZ and how I can use WorldRotation in this situation?

GetWorldRotation returns a Vector3 instead of a number, so you need to use:

Transform.Event.GetWorldRotation(self.entityId).GetZ()

To get the Z value you’re looking for.

1 Like

Thank you very much, this works perfectly!