My problem is: how to make raycast or linecast (to detect player) form enemy eyes. Enemy can turn to face player after he detect him, so raycast from must rotate with enemy to emulate enemy vision direction.
To explain more:
My problem is: how to draw a raycast in front of the enemy (just like from enemy’s eyes), and rotate it when enemy rotates.
Checking if a character see something is not a problem.
Contrary to what ryandotdee says, in top-down perspective it’s transform.up that gives you the direction your character is pointing (provided that the original imported sprite is facing upwards)
Similarly, a sprite which faces downwards in the sprite sheet would use transform.down