Additional Scripts

v1.0

Projectile Factory comes with additional scripts. Some interact with Projectile Factory systems, while others simply help you do cool things. Smaller scripts are discussed briefly on this page, while others have their own subpages with details.

Face Direction of Motion

Add FaceDirectionOfMotion.cs to any object with a Rigidbody that you want to turn to face (z-direction) to the direction of motion. Useful for thigns like arrows that are following a physics trajectory.

Fade Light

The FadeLight.cs script will fade a light out over time. It can automatically start OnEnable, which is great for things like a muzzle or impact flash. Otherwise, the StartFade() method needs to be called to trigger the effect.

On Enable Change Size

Sometimes a projectile is bigger than the spawner, and looks odd when instantiated. The OnEnableChangeSize.cs component will change the scale of an object over time, starting OnEnable. Use this to quickly scale an object up, allowing it to appear more natural when existing a spawner.

On Enable Fade Material Color

This will fade the color of a material starting OnEnable. If you fade the alpha value, you can fade the object into existence over time.

On Enable Turn Collider On

Sometimes you may want to keep a collider turned off for a period of time. This will allow you to turn on a Collider either OnEnable or after a specified delay.

Play Audio Clip On Awake

This simple script will play a random AudioClip from a List of clips on Awake.

Turn Off Objects On Collision

This was made specifically for the integration with Realistic Effects Pack 4. It is used to turn off specific objects when a Projectile collides.

Toggle Lights With Projectile Launch

This component will turn lights on and off, ensuring they turn on when the projectile is launched, and off otherwise.

Toggle Particles With Projectile Launch

When the Projectile is launched, particles will play, otherwise they will stop.

Trigger Movement On Spawn Point Change

This was made for the integration with Sci-Fi Effects by FORGE3D, and handles the movement of the turret barrels. It triggers some movement when the spawn point is changed to "this" point, which is how we achieve the barrel motion when the turret fires.

Last updated