2D RPG Collider Problems

Hey guys, been searching for awhile but haven’t been able to find a resolution the problem I’m having. Currently I’m working on a 2D RPG using Unity 3d and 2D Toolkit, but am having a heck of a time with invisible walls of all things.

On my player I’ve got a rigid body with Kinematic and Gravity unchecked as well as a capsule collider with a very basic Movement and Animation script. On my Invisible walls I’m just using squares with Box colliders and no rigid body. The thing is that I can make the collision with the box just fine, but if I touch any corner of the box my character starts to rotate and starts drifting slowly away from the box from the box, I solved part of the rotation problem by attaching a Configurable joint on my character but still seem to have both issues, any help would be greatly appreciated!

Below’s a picture of the problem, as soon as I release the move key, the player just starts drifting away.
PIC: ImageShack - Best place for all of your image hosting and image sharing needs

3 Answers

3

I forgot to mention last night I tried applying the Character Controller to the player as well, and he seems to just want to go through the object. If I attach a Rigidbody to my invisible wall and uncheck Gravity and Is Kinematic then the cube gets knocked away from the player, but lets me know that my player is making contact. Sorry, I’m sure this is something brain dead simple. I’m really only using the Y and X axis as it’s a top down game.

Player Character Control Settings:

Invisible Wall collision settings: ImageShack - Best place for all of your image hosting and image sharing needs

Don’t use a rigidbody. Use a character controller instead.

Ah thanks! The problem was that I wasn't using move or simplemove, so the character controller collider was having problems, all fixed now!

This was 2011 but I wanted to help anyone looking for another answer now

So to disable rotation go to:

Player > Rigidbody2d > constraints > freeze rotation z

Unfortunately, this means that you won’t be able to rotate it with rigidbody2d.

Sorry if this doesn’t work, some of what I’ve said is wrong or is a bad way to stop the rotation I’m quite new to unity.