What to use for precise movement with collisions?

After searching around for a while I’m pretty confused about transform, rigidbody, AddForce, MovePosition and stuff like that, so I thought I’d just ask this question here.

If I want to make a basic movement for a Space Shooter, Jump ‘n’ Run or 2D RPG like on the SNES with the following properties:

  • Should be able to stand on colliders
  • Should stop when coming in contact with a collider
  • Pressing ‘Right’ should instantly move the character right at full speed
  • Releasing ‘Right’ should instantly stop the character

What do I use? What I want is basically what every game of the time used. Precise movement and box colliders to stop the character. No acceleration, no ice physics, no physics collisions that lead to the character spinning around or anything like that.

Everything I try leads to either the right movement but with no collisions being detected (Transform in Update) or ‘floaty’ feeling physics (Rigidbody in FixedUpdate).

Hope you can help me.

High drag and high forces is what I do to get that behavior. The high forces overcome the high drag and the high drag stops the character on a dime.

You can also use Rigidbody.MovePosition to move the rigidbody instantly while also obeying the collision matrix.

Or you do not use physics and move the objects via their transform. You could still use the colliders (raycast) or do it by hand as well (positions & texture size)