- Home /
2DColliders going through eachother
Hi. I'm making a game where a guy needs to move blocks by bumping into them. I gave the blocks and the player a 2D boxcollider and I gave an empty object a collider to prevent everything from falling off the screen. Now when I move my player, the block-colliders are going through each other. I want the blocks to be 'stronger' so they won't overlap. I gave the blocks a rigidbody too. I know this problem with colliders has been asked a lot but I don't know how to fix this.
Look at the pictures below if my question is unclear
I'd like to help, but I'm not sure if I understood the problem... But let me try: You have two GameObjects which both have a Rigidbody2D and a BoxCollider2D. And when you move one of them towards the other, the colliders have no effect at all? They just pass through?
If that is the case, then:
Do both GameObjects have a Rigidbody2D?
Do any of the GameObjects' BoxCollider2D have "Is Trigger" checked? This will disable collisions, and ins$$anonymous$$d call the OnTrigger()-method in the scripts.
Do any of the GameObjects' Rigidbody2D have "Is $$anonymous$$inematic" checked? A kinematic object will not be physically affected by collisions.
Hi mlavik,
Sorry for responding so late. I didn't have access to internet for a couple days. I have 2 GameObjects. both have a rigidbody2d and a boxcollider2d. When I push both of the gameobjects towards the edge of the level I want them to be solid, and not slide into eachother. Its kinda hard to explain so I made a little video of the problem:
https://www.dropbox.com/s/8d2v1q1xj23d1my/colliderproblem.mov?dl=0
Also the GameObjects are unchecked for triggers and $$anonymous$$inematic is also unchecked
I do believe if you try to set transform of the gameobject ins$$anonymous$$d of using the rigidbody it may cause this.
Answer by nsfnotthrowingaway · Jul 13, 2017 at 10:07 PM
Did you try setting the RigidBody collision detection type to continuous?
Your answer
Follow this Question
Related Questions
Object passes through collider even when isTrigger is turned off. 2 Answers
Box Collider 2d don't collide 3 Answers
Object hits another but doesnt bounce off again. 0 Answers
Is there a way for 2D Box Colliders to ignore another? 4 Answers
Make colliding object not collide in overlapped area 0 Answers