Hi, i have node called "ghost" which should follow the player everywhere, however, it does not.
It just keeps going to the right, even thought it counts well the angle. I suspect there is something broken in the calculation of the final move vector, but since it is simple trigonometry, I believe I setted it up correctly.
I would gladly accept any tips on what might be wrong.
How does it look like: (the godot icon should follow the player)
Here is my ghost code:
var reached = false
const SPEED = 1
const ROTATION_SPEED = 20
var ang = get_angle_to(get_node("../player").get_pos())
var x = cos(ang)
var y = -sin(ang)
func _on_player_body_enter( body ):
reached = true
func _on_player_body_exit( body ):
reached = false
the final vector of the ghost (/ kinematicbody2D) is always 1 on x. how so?