Raycasts not pointing to players pos

Godot version is:
Godot 4.2.2

raycasts not pointing properly to the players position. im pretty sure it has to do with this line of code:

the rays variable was a variable which has an array of raycasts inside a parent raycast node

func ray_tracking():
	for rays in ray_children:
		rays.target_position = (player.global_position - rays.global_position) * self.basis

help? the raycast is pointing to the sky instead?

Try the global basis, if that doesnt work just use to_local()

1 Like

Would it be better to use to_local? The inverse basis multiplication may be in the wrong order?

rays.target_position = rays.to_local(player.global_position)

thanks!