Good day.

I have a model and a script that moves it forward (using the transform.Translate method). The problem is that it passes through other objects (obstacles). The model has a box and a mesh collider, rigging. If you move the script to a primitive (cube), then everything is done as it should. On the obstacles there is also a riggingbad, box/mesh collider.

Tell me, what could be the reason?

screenshots:

enter image description here

enter image description here

screen model

enter image description here

the project itself

  • Attach screenshots of the components on the obstacles and on the object. - Valera Kvip
  • @ValeraKvip There is - mr.robot
  • And the screen on the model? I understand that the primitive that works on the screen as it should!? - Valera Kvip
  • Try rigbodody to change the collider detector detection mode from discrete. On Continuous Dynamic. If it works - accomplish your goal. - Andrew
  • @ValeraKvip yes, everything is fine on a cube. hostingkartinok.com/… - screen model. Character Controller has disabled, nothing has changed - mr.robot

1 answer 1

The problem in this line is:

 void OnCollisionEnter (Collision collision) { Physics.IgnoreCollision (collision.collider, GetComponent<Collider>()); } 

I do not know the purpose of this, but this function blocks all collisions. And also Mesh Collider which also behaves strangely. You have done something in your character, there was no time to understand what, I deleted it and created it anew (see screen). And it works. enter image description here

  • Oooh, thank you very much! Without the mesh of the colider, everything worked)) - mr.robot