0

Why is my person walking through trees?

How can my character go through a tree when my character has a rigidbody/mesh collider and my tree prefab has a box collider? I want the tree to act like a barrier

colliders don't detect each other, I want the tree to act as an obstacle

fox inspector tree inspector

3 Answers3

0

im assuming you are painting the trees on the terrain. If so then remove the Terrain collider in the Tree1 prefab and then refresh.

0

Check theese:

  1. Check if collider component is active & working on your fox & tree (because that's marked removed)
  2. in Physics window, check that player's & tree's layers can have collision with each other
  • I don't know how to do these is there a video where I can learn –  Mar 24 '22 at 17:04
  • [This link](https://docs.unity3d.com/Manual/class-PhysicsManager.html) to check the 2nd thing I said –  Mar 25 '22 at 04:11
  • thanks, it worked when i changed its layers –  Mar 28 '22 at 10:45
0

Firstly, you need to assign Terrain Data because its look like none.

bmoglu
  • 59
  • 6