Projectile Data
v1.0
Last updated
Was this helpful?
v1.0
Last updated
Was this helpful?
Each has a ProjectileData
object attached to it. Many behaviors will make use of the Speed value on this object, to determine how fast the Projectile should move. The demo scene also utilizes the Damage value.
Most likely you will want to create a new class which inherits from ProjectileData
, and has additional data you need for your projectiles.
Each game is unique. Projectile Factory comes with the extensibility required to let you build YOUR game.
This is the "Fast Projectile" in the demo scene, and some projectiles use this to move faster than others. The Damage value is used when a projectile collides with the Demo Target. Check the console, and the script, to see how.
The ProjectileDataDemoDamageOverTime inherits from ProjectileData, and is used for demo projectiles like lasers and flame throwers, which likely cause damage over time rather than per collision.
Here we update the CreateAssetMenu
options, so that you can create new Scriptable Objects
of this type, and override the CalculateDamage()
method, multiplying it b y Time.deltaTime
.
Your custom classes can go deeper, if you'd like, connecting your projectiles to your game data and stats, and even adding additional Properties
that work with your custom specific to your game.