Movement Methods that have collision check.

I am making and 2D platformer prototype. I could make it easy with character controller, but i need an box collider instead of and cylinder one.

I am now trying to make a "custom" Character Controller but i can't find any method of doing a movement that check collisions.

What i've tried:

  • Use rigidbody.position
  • Use rigidbody.MovePosition
  • Use transform.position
  • Use transform.translate

Every method above make the moving object pass trough other objects.

What i've checked:

  • The moving object have rigidbody and box collider.
  • Other objects have box collider.

It use rigidbody gravity and with that it colliders with the ground. What method it uses to it? Can i use it or is "hidden"?

I can't think any more possibilities. Thanks in advance.

PS: If i made any spelling errors its because english is not my native language. Still mastering it.

Hey man, check out the FPS rigidbody walker http://www.unifycommunity.com/wiki/index.php?title=RigidbodyFPSWalker

You want to be controlling its velocity directly or by using the AddForce function.

Also check the collision matrix if you don't have rigidbodys on the other colliders.

Hope that helps :)

rigidbody.MovePosition does check collisions and won't move through other objects, assuming they can collide at all in the first place.