- Home /
Error on checking collision or code desync?
I was making an 2D character controller based on an object with a rigiddbody and a box collider.
I got everything right and working, except for the collision.
First the code: http://nopaste.info/5758934778.html
The problem:
When the character stand on an edge of a platform and jump, it slips down like the collision that was checked was the left one insteaf of the top one. What i can see is that the collisions work, but whem i jump the code aways get the wrong collision check.
[Edit by Peter G to try to clarify the question]
When the character is standing on top of the platform and jumps/falls off the sides, he slides down the side (when he should be able to stand?). But when he jumps up from the bottom of the platform, he drags on the sides and begins rising up.
[end edit]
Here is an explanation of the pictures.
- The character is standing on the left top edge and jump - When the character falls it slips off the edge.
- The character is standing on the right top edge and jump - When the character falls it slips off the edge.
- The character is standing below the botton left edge and jump - When the character touchs it slip to the left and continue to go up.
- The character is standing below the botton right edge and jump - When the character touchs it slip to the right and continue to go up.
An image to explain:
Its been 2 days and i can't figure out what to do it. Thanks in advance.
EDIT : No, i am not using a character controller and yes i have triple checked the code.