Player game object passes through walls.
Rigidbodies are not registering collision.
How can I fix it?
Player game object passes through walls.
Rigidbodies are not registering collision.
How can I fix it?
Check how you are moving the player. There are a few reasons for why this could be happening:
If you are moving the player via physics, this should not happen. It then could be causes by various things such as the max penetration value in the Physics settings.
Remember of course all objects need colliders on them. Something you may not know is that two mesh colliders will not collider unless one is ether a Static object, or one is marked as Convex. This is built into Unity to prevent physics issues. If this is the case, try replacing the colliders with primitives such as Box colliders and test.
EDIT: Seems now in unity 5 its slightly different, here is what the doc says:
There are some limitations when using
the Mesh Collider. Non-convex Mesh
Colliders are only supported on
GameObjects without a rigidbody. If
you want to use a Mesh Collider on a
rigidbody, it needs to be marked as
Convex.
If you are moving the player via its transform.position, then you are going to encounter these issues, as there is no reasonable way for the engine to check if the player will collide until the next physics update.
Can you give us the code you are using to move the player? Preferably the whole script.
Do all your objects have Colliders on them? Are the Collider’s “Is Triggers” box clicked on? (That’s what used to get me in trouble)
even though i am a total noob (so don’t take my word for it) the answer is to make the wall & floor (instead of a plane) into a cube that is thick. this partily solved my problems at least.
If something is set to freeze axis x, y or z on rigid body then it will move right through things of that axis to it regardless of collision boxes. Check that and that all your collisions are correct.
It is not Rigidbodies that register walls, its box colliders(or box colliders 2d).
Try adding some colliders
If you have a Rigidbody and all the proper Colliders and you’re not ignoring the collisions via code or anything like that… Try setting your Rigidbody’s Collision Detection to “Continuous”.
Discrete Detection: Checks the next frame “Is the collider touching another collider in this frame? If not, move there, if so, we collided”
Continuous Detection: Fires a Raycast in the direction of movement to check the collision before they happen.
There’s an easy way of solving this. First of all check if the wall the player goes through has a rigidbody in it, if not then click on component (which is at the bottom of your gameobject (object) - which in this case is the wall).
@ButterCream87 I have same problem, the object through wall/object/cube. The problem solved after I reinstall the Unity software.,I have same problem, the object through wall/object/cube. The problem solved after I reinstall the Unity software.
Check this place for my question LINK: https://answers.unity.com/questions/1886811/why-character-is-going-through-the-floor.html