Feb. 27th, 2018
Scripting Enemies to Check Distance for Ranged Attacks – Unity
Scripting is Fun – Unity 2D Game Basics – Enemy AI – Ranged Attack – Youtube Video
This video shows the basic setup for allowing an enemy in a 2D game to rotate, locate player with raycasting and distance tracking, and fire projectiles in the proper direction.
This is placed here for the use of layer masks to control raycasts. Layer masks allow the user to either ignore specific layers with their raycasts, or specifically target layers. This was searched because I had an issue where raycasts where colliding with the object itself and/or the parent object, both of which have colliders.