I noticed that when my trees in my game have colliders, the framerate drops by something like 100 (the trees are part of the terrain). What I would like to do is to have the trees check the distance from the tree itself to any moving object, and if the object comes close to it, then turn on the collider, and if the object is farther away, turn it off. I tried attaching the script to the tree asset and then updating it in the terrain engine, but the script doesn’t run. Is that because the trees aren’t actually GameObjects? In that case, is it possible for me to:
- Add a script to a terrain tree
- Reduce overhead by disabling tree colliders
Thanks in advance!