Can foliage have collision?

Is there a way to give foliage collision shapes, so that the player can’t walk through things like boulders and trees?

I think mesh colliders will do the job, just right click on the foilage in the hierachy and select the option add mesh collider

Yeah, I already tried that. It didn’t work. Thanks though.

Did you create a collision data for the mesh collider?

I dont think mesh colliders were intended to be used with foliage. Even with the collision data baked there is no way to add it to the foliage.

In future, I’d like to add some options for prefabs spawning on foliage so it could have custom scripts/colliders. But for now, you can use Foliage API to extract foliage instances locations and place there colliders.

1 Like