A demo project on allowing 2D sprites to spread fire.
ChemicallyReactive script to a root GameObject.
Add the Chemical the object responds too. In this case there is only Fire in the current project.
Add the Plant Script (May rename to something more generic later)
Setup the Plant Script to react to the Chemical. Ie Change the sprite, enable a particle system, etc…
CREATING NEW CHEMICALS
Chemicals are simply ScriptableObject, so you can have as many as you like.
- Right-click the Project folder and select Create > Chemistry System > Element Type
- Name your new chemical Ice, Water, Slime, Candy, Toxic, Dynamite, whatever.
- Create a new GameObject that will hold the element.
- Spread the Fire chemical to other
ChemicallyReactiveto Fire GameObjects
- Destroy the Fire when the
ChemicallyReactiveGameObject is fully burnt.