How to know what RayCast2d IsColliding ?
Hi, I'd like more information on how RayCast2d works.
I'm currently working on a script for AI's in a 2d platformer, they emit raycasts to the player in their field of view, however I need to know if the ray collides with my tilemap before it reaches the player.
On all the tutorials I've seen the developer retrieve an "Object" with the GetCollider() function and then use IsInGroup() or GetName().
Except that these functions are not present in the Object class.
Could you tell me more about this?
At the moment I use 2 raycasts with 2 different layer Mask to know if there is a collision with my tilemap.