- Home /
Object wont move after collision with more than one point
Hello, I am creating a 2D room where the walls are box colliders. I have an object in the room that has a box collider and a rigid body component, I am changing the gravity direction based on the accelerometer. that works, but
It seems that i cant move the player (with the box collider) after it has rested on one of the walls, or touched 2 walls, like in a corner. is it constantly in a collision loop or whats going on. i want to be able to flip the accelerometer around again and it would drop down again, but it just gets stuck. when i try to change its location programmatically to some other place where its not touching the wall, it seems to move again.
any help?
Answer by ryanbuddy1 · Jul 15, 2011 at 02:13 PM
You will need to add force in the upward direction of your box when trying to move it as it is probably getting stuck in one of the walls of your level.
Put the below in script when you press a button to move your character and it should work:
rigidbody.AddForce (Vector3.up * 10);
Your answer
Follow this Question
Related Questions
Collision detection not working properly with 2D sprites 1 Answer
Unwanted results from 2D collisions? 1 Answer
Collider2D.IsTouchingLayers() delayed reaction 1 Answer
No Collision in 2d Scene 0 Answers
Creating 'redstone' like wires 1 Answer