1. Home
  2. Docs
  3. Magio
  4. Tutorials
  5. Use Magio with Unity Terrain Trees

Use Magio with Unity Terrain Trees

Example: You are using built-in Unity terrain in your project. You want some of the grass or trees or everything in your terrain to be able to catch flames.

Additional information:

Backup your terrain! Magio will manipulate trees in runtime, so in case of a rare blue screen on your computer you can lose data!

Magio can be used with Unity Terrain (Prefabs placed as trees. Can be bushes etc as long as they are placed with a tree tool). Magio checks with predefined intervals if there are any fires close enough to unity terrain trees. If some tree is close enough, Magio will replace a tree instance with a prefab on the same position/scale/rotation as the tree. After that it will act like any flammable object and is deleted if it is not ignited and the fire moves farther away. 

If your scene has a huge amount of trees and a huge amount of magio objects, be sure to cull far away/non-important magio objects and trees to avoid unnecessary checks and draining the performance. Also this will leave faded out gameobjects (effect already faded away, whole life cycle completed). So if you have a large scene you should replace these with faded tree instances or destroy them when the player is farther away.

Steps:

  1. Backup your terrain! Magio will manipulate trees in runtime, so in case of a rare blue screen on your computer you can lose data!
  2. Enable “Unity Terrain Compatible” from MagioEngine in your scene.
  3. Convert your tree prefab you intend to use normally to the Magio object using instructions in “Convert Object to use One Effect” or “Convert object to multi-effect Magio Object” or use splash effect explained in “Create a splash effect”.
  1. Add the converted object normally to your terrain trees:
  1. Note that you can add bushes also to trees if you want.
Was this article helpful to you? Yes No

Leave a Reply

Your email address will not be published. Required fields are marked *