How would I make my raycast follow a node (specifically the player):

Godot Version

v4.2.2.stable.official [15073afe3]


So I have a am working on an enemy and I want it to be able to follow the player using a raycast node that will point towards the player. I’ve tried some different ideas but none of them seem to work. How would I get the raycast to follow whatever node I need it to?

1 Like
func ray_cast_follow():
	ray_cast_2d.global_rotation = look_at(#whatever pos you want to have it look at , example get_global_mouse_position)
#just rotation might work better
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.