So I’ve just gotten into playing around with unity and started creating my own platformer, but now I need to make a script for my enemy that can detect when the player is near and attack the player and play an animation. I would appreciate any ideas or solutions that could help me reach this goal.
You can use other casts if they suit your tastes better than a regular Raycast:
-
CircleCast if you want the enemy to attack once the player is detected within a certain radius.