|Topic was automatically imported from the old Question2Answer platform.
I am trying to use a raycast2d added to the enemy to see if it collides with the player and if it is then tell the enemy to shoot. The problem is that the raycst2d is not colliding at all I set it to enabled and set the cast_to so it should collide but it doesn’t. Is there another way to make a targeting system for an enemy that is an airplane moving in the x axis in the top part of the screen and shooting down or am I missing something that makes the raycast2d not working?
This is the code for cheking if the raycast is colliding the cast_to is set from the ui :
var object= $RayCast2D.get_collider()