How do I make the direction of an object a variable?

Godot Version

4

Question

How do I make the direction of an object a variable? it would help a lot if code was provided

You mean rotation?
It would be great if you say what type of direction you want to store : )

yes i meant rotation, thank you : )

1 Like

Then just use

var direction = rotation_degrees
#or 
var direction = $Playernode.rotation_degrees

There are many .you can use global_rotation or just rotation and if you want to store specific axis then use rotation.x/y/z what you want.

2 Likes