I am wanting to create an energy shield for ships in my game. I know I can create a simple collider / mesh for the shield and set it to invisible (or disable renderer) and then re-enable the renderer when it gets hit and then instantiate a ship shield collision effect prefab for the shield, but i am curious how to avoid instantiating a prefab of a shield effect.
I heard in another forum (this one): Forum post that i can do this.
If you are doing a spherical shield, you can probably put a sphere around your ship, then via script change the color and alpha where there is a collision. I believe the Space Dock widget from the widget contest did this.
How would i achieve this? If a shader is needed, how can I make one with strumpy shader editor?
The qualities I plan to achieve are the following:
- An almost transparent sheild
- When hit, the shield at the collision location glows and becomes less transparent and then fades back
- An effect that can be added to the collision area (maybe using a prefab or emitter)
- Mobile kept in mind, so efficiency is a concern
- Not permanent / static (on a moving object and shield has health)
An example images of what I’m looking for: