Ranged Enemies
Last updated
Last updated
Ranged Enemies is a feature introduced in version 1.1.0. It allows you to quickly and easily add enemies that shoot projectiles in different manners.
Ranged Enemies share all the base settings with Simple Enemies. However, there are some notable differences. To see how this setup works in practice, let's take a look at the example prefab.
Navigate to and open it.
Prefab structure is the same as for Simple Enemies, apart from the Behavior Script. As usually, it is attached to the parent object of this prefab.
Take a look at the Ranged Enemy Behavior script. It should look like this:
Adjust the settings according to your desires.
Projectile Prefab field has to link to a proper projectile for this to work.
Let's take a look at the example Projectile prefab.
Projectile prefab has a parent object, and a particle as a child. You can use any particle that fits your vision here.
In the parent object you will see 2 important components: 2D Collider and a Simple Enemy Projectile Behavior Script.
Make sure that your projectile has these components attached
Also make sure that Layer is correctly set to Enemy Projectile.
Navigate to and open it.