Scripting Visual Effects
Visual feedback is the concept of using different VFX, such as particles and a VFX graph, to reinforce what is happening. For example, say right now we are shooting our weapon, and we know that this is happening because we can see the bullets. However, it doesn’t feel like a real shooting effect, because a proper shooting effect should have a muzzle effect on the tip of our gun. Another example would be the enemy dying—it just disappears with no animation! That doesn’t feel as satisfying as it could be. We can instead add a little explosion (considering they are robots).
Let’s start making our enemies spawn an explosion when they die by doing the following:
- Create an explosion effect or download one from the Asset Store. It shouldn’t loop and it needs to be destroyed automatically when the explosion is over (ensure Looping is unchecked and Stop Action is set to
Destroy
in the main module). - Some explosions...