- Edited
Hello! Im am trying to get a spaceship working with full controll of rotation but it doesnt seem to work correctly. It is meant it going to go along a local axis but it has this wierd thing going on. I put the link here to a video to describe my problem. I included keyboard sound to make it clear when i click another button. This is my code:
func _physics_process(delta):
if Input.is_action_pressed("Rotate_Forward"):
rotation_degrees += transform.basis.x
if Input.is_action_pressed("Rotate_Backward"):
rotation_degrees -= transform.basis.x
if Input.is_action_pressed("Tilt_Left"):
rotation_degrees += transform.basis.y
if Input.is_action_pressed("Tilt_Right"):
rotation_degrees -= transform.basis.y
if Input.is_action_pressed("RotateLeft"):
rotation_degrees -= transform.basis.z
if Input.is_action_pressed("RotateRight"):
rotation_degrees += transform.basis.z
Thanks for you time!