Sci-Fi Effects
by FORGE3D
Last updated
by FORGE3D
Last updated
Sci-Fi Effects contains great particles with really wonderful sounds, and the ability to construct sweet turrets, or just use the ones ready to go in the pack.
Navigate to the "Asset Store Integrations" folder, and extract the .unitypackage for Sci-Fi Effects. This will install the prefabs and any other required assets.
If you have Sci-Fi Effects already installed, the Projectiles should work right away. There is also a demo scene ready to go for you to test and see them in action.
Remember the Projectile Spawner has an option for multiple spawn points -- this is how you'll enable multple barrels on a single turret. You can even customize the order by making your own Spawn Point Manager.
I re-did all of the logic for this package. The original scripts are not easy to use, non-modular, and can't be hooked into. But, that's probalby why you're using Projectile Power, because you want modularity and flexibility!
In the demo scene there is a Demo Turret. Lets break down what this has on it.
The object has the Projectile Spawner on it, and the Projectile Demo Actor. We also have a Look At Mouse Position In 3D World component. This is a more consice script that has nearly the same effect as the script in the Sci-Fi Effects demo scene. This is what moves the turret when the mouse moves.
Both of these objcts -- "Swivel" rotates horizontally, "Mount" vertically -- have a Simple Look At component, turned off. If you turn both of these on, and turn off the compoent on the parent object, then the turret will look at the target automatically, rotating as the target moves.
Now that the particles are in Projectile Power, they're super flexible. To show an example of this, the Plasma Gun effect is set up a bit different.
The Projectile Data is a slower speed, and the Movement Behavior has a behavior that will make the particle follow and move toward the target. If you want it to be fast, change the Projectile Data object. If you want it to move straight forward, change the Movement Behavior. Entirely up to you!
Some projectiles will have a Projectile Raycast Hit Detector
component. If they're moving very fast, a collision or trigger may not occur -- the collider may move entirely past another collider between frames. This component will use a raycast forward to check for collisions. With slow moving projectiles, it's obvious that they disappear early, so this works best for fast moving projectiles.
There are "impact" and "muzzle" particles as well. The "Muzzle" particles are spawned at launch, with a Spawn Behavior Modification on the Projectiles.
These particles have a Projectile Power Destroy script on them, so that they can be destroyed or sent to the object pool, if you're using it.
The light objects found in the impact and "muzzle" (launch) particles, which are instantiated when a projectile is fired, often have lights. These will have a new Fade Light
component on them, which will fade the light quickly.
The Projectile Power Destroy
component will have the quads on these particles listed in the Objects To Destroy Immediately list, often with a very short delay, so they appear to flash.
These particles also have a Play Audio Clip On Awake
componet, which is where the "fire" and "impact" sounds are coming from.