Posted June 26, 2021 by CRT Glow Studios
#dev #lighting
Whilst adding some destructible objects (i.e. barrels) I thought it'd be fun to play around with Unity's Light 2D and Shadow Caster 2Ds to get a fire flicker effect (please excuse the WIP particle system used for the fire).
The flicker effect is just a Script that randomly moves the position of the light 2D on the Fire Game Object.
I keep the barrel's shadows from casting onto other barrels by using a CompositeShadowCaster2D. Just create an Empty GameObject - pop the composite caster on it, then add your barrels as Child Game Objects.
...
...
And of course, no barrel is safe from inevitable destruction at the hands of a greedy adventurer!