Godot Version
v4.3.stable.official [77dcf97d8]
Question
I want to rotate my car controller (CharacterBody3D) based on the input. This works with all directions beside “up”. In this case, I have problems rotating the car slighty left
Reason: up is 0 degrees. up-left is -270 degrees so it makes a spin. Has anybody an idea to solve this?
Script:
func rotate_point(delta) -> void:
var siggn = 1
if last_direction.cross(Vector3(0, 0, -1)).y < 0:
siggn = -1
rotation.y = lerp(rotation.y, last_direction.angle_to(Vector3(0,0,1)) * siggn,
turn_speed * delta)
Thanks for any help!