Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lalel345 |
why this doesn’t work?
if event is InputEventMouseMotion:
transform.rotated(Vector3(1.0, 0.0, 0.0), deg2rad(event.relative.y * 0.1))
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | lalel345 |
why this doesn’t work?
if event is InputEventMouseMotion:
transform.rotated(Vector3(1.0, 0.0, 0.0), deg2rad(event.relative.y * 0.1))
Reply From: | Bean_of_all_Beans |
So the method rotated
for Transform
returns a new Transform
with the appropriate rotation. To make use of that returned value, you would want to put the following into your code:
transform = transform.rotated(Vector3(1.0, 0.0, 0.0), deg2rad(event.relative.y * 0.1))