👀Overview & Quickstart
Extensible projectile system for quick projectile creation
Last updated
Extensible projectile system for quick projectile creation
Last updated
Projectile Factory solves two common problems Unity developers face when creating projectiles: Creation & Runtime Use.
Creating projectiles is simple at first, but often developers find that they want new projecitles that do things...differently from the others. Firing one bullet, simple enough. But what about a machine gun? Or a bullet with some built-in inaccuracy? Or an arrow? Or a bullet hell mothership with hundreds of projectiles in a pattern?
In Projectile Power, each Projectile is made up of Behaviors which determine how the projectile spawns, moves, collides, and more. In the exampels below, we get two Projectiles with slightly different Spawn Behavior.
These behaviors can be mixed and matched, and each behavior is a Scriptable Object, so you can have any number with various options set how you'd like.
And if you're like me, you have tons of killer particle packages from the Asset Store, and you want to use them in your project. Many find that each particle package can set up wildly different from the others. Sometimes they're set up in a way that requires a large amount of manual work to actually use them.
And even then, they all work slightly differently. With Projectile Factory, your projectiles become uniform, no matter what particle package you're using, so you can quickly mix and match in your game. We also include many 3rd Party Particle Integrations that have projectiles ready to go for instant use.
Projectile Power comes with many Behaviors ready to go, and a demo scene showcasing very common projectiles found in many games. If you want something more custom, you can easily create it.
At the core, each behavior starts as a very simple script. You can create new classes which override key methods in order to create custom behaviors, or add additional functionality that better fits your project.
You can even sell what you create on the Asset Store 🤑
Objects that spawn projectiles are called... Projectile Spawners! With a clean custom Inspector, it's easy to add Behaviors and make new Projectiles for your game.
Simple methods like SpawnProjectile()
, NextProjectile()
, StopProjectile()
make it simple to hook up your player and NPC controllers to Projectile Power.
Once launched projectiles each have a Projectile class -- also extensible. Other scripts can subscribe to event based notifications such as Launch()
, OnCollisionEnter()
, OnDisable()
and more. In fact, this is how the various behaviors on the projectile are notified of events, including UnityEvents
in the Inspector.
In addition to the behaviors, you can also create Projectile Observers, which are similar to Behaviors, but do only what you code them to do.
In the demo scene, we use an observer to cause damage to the target when a projectile successfully hits it. This is a super common use case, and allows you to easily connect your game logic with the Projectile Power projectiles.
Dig into the demo scene and documentation, and if you have any questions, come ask on the Discord!