Hi again,
I have found a simpler solution. I use a Path
with a PathFollow
. The PathFollow can be set like this:
pathfollow.offset = path.curve.get_closest_offset( point_somewhere )
var basis = pathfollow.global_transform.basis
var y_direction: float = Vector2( basis.z.x,basis.z.z ).angle_to( Vector2( 0,-1 ) )
I use PathFollow
with Rotation Mode = Y
, and I can calculate the y_direction by the transform.basis
.
Thanks
Mike