I’m making a Space Sim and the starships/capital ships need to have shields. So what I tried to do is create a duplicate of the object make it slightly bigger, and added a transparent blue material to the shields to make it shield like, and so you can see the main ship under. The problem was, now the ship is slightly tainted blue, so I wanted a shield that was invisible, but when a laser hits it, blue particles appear in the area that it collided in. I’ve looked at the other question liked this, but It didn’t make sense to me, so I wanted a way similar to my approach. Can anyone help? Thanks in advance
I'd probably do as follow : set your shield's renderer to false, give it a sphere collider and set its isTrigger to enabled. Now make a script with a function OnTriggerEnter and inside it call the function Overlap Sphere that will return all the colliders inside a given radius (your shield's radius). Get the inverse direction of the colliders and instantiate a prefab particle system containing the desired effect you want. Finally, destroy the gameobject of the collider. You will also have to filter when the overlap sphere is called and the effect to happen only with enemy bullets, but that is simply a compare tag call.
I'm not sure if this is the best way to do it, but it's actually fast enough.
Check my other question because if you’re taking the same approach as me, it answers this question. Thank you everyone who helped me. Different Explosions For Different Collisions