Godot Version
v4.3.stable.official [77dcf97d8]
Question
I want to preface this, I am not a mathematician and i have no clue how quaternions work. I plan to learn but i just want a solution right now.
I’m making a golf ball player controller and need to know how to “roll” it in the direction its going to without getting messed up.
Let me know if you need clarification and thanks in advance
Oh! and using the physics engine is out of the picture, doesnt suit the game. I tried lol
You probably want the cross product of the direction to the world’s UP vector, which returns a vector that you can use as axis for your rotation.
func _process(delta: float) -> void:
var cross := your_direction.cross(Vector3.UP)
rotate(cross, delta * your_speed)
The rotational speed will be related to the velocity of the golf ball, but that should be easy to calculate.
Alright, I’ll try this when i get out of school. Thanks!