How to trigger(NOT collide) bushes placed to terrain

Hi,

Working on my exterior scene I met a huge trouble.

Target: to make some bushes interactive to play sounds/particles when character walks through them
Approach used: created new bush prefab, set collider to “is trigger” and changed layer to “forest”. Set forest layer to interact only with “player” layer.
Problem: when setting bush prefab to terrain seems that become part of terrain and become a child. Layer changes and collider “is trigger” sets to false. As a result I get solid rigidbody when character tries to move through the bush.

I found a few solutions about making terrain tree interactive to destroy it, but can’t get a point, hot to make it works in my case.
Any solutions here?

I have a tricky idea. I wonder if you could make two bushes, one for terrain and the other a on trigger interactive one. Have the terrain ones create an interactive one in their same position and then delete them self as soon as the game starts. It might have performance issues though because of how many you would be spawning. Maybe if you add an onCollision on the terrain ones to make the interactive bush and delete self when the player touches them.

There might be a far easier solution.

1 Like

That’s the way, thanks.

We thought about another solution on our end - what if to create some editor script, which will spawn all my bushes outside the terrain by prefab at the same position/position/scale as they are spawned inside the terrain end remove terrain data… That will not raise performance problem, but will destroy terrain bush spawn pattern. If to backup it, that will not be a big trouble…

Anyway, both solutions are too complex. There MUST be some easier solution… People somehow did it. :slight_smile:

Another solution I found is to disable colliders at bush prefab in “Tree” terrain option, and create a copy of objects contained only colliders. Create custom editor script to spawn those colliders copies over the terrain. That method is better the method described in previous post because that will not break wind affect to the bushes and they will be controlled by terrain.

Do someone got better solution?