How to make a rigidbody playable character

I am trying to make a 3rd person playable character, which is just a few shapes for now. I can make him move perfectly using scripts, but I can’t give him gravity without using a rigidbody. When I try to use rigidbody he falls over. When when I try to use a simple rectangle it topples over with rigidbody. When using the constraints in the ridigboy control to stabilize my character it then removed the effects of gravity!

Does anyone know of a tutorial on how to do this? Every tutorial I see uses the prefab which does not move or look how I am going to want. -or- the tutorials show how to make them move, but not with gravity.

I have been trying to make my character move for 4 days now! I can’t figure out the trick.

Just restrict the rotation to the sides so the object doesn’t fall over. Seems to work fine for me.

He doesn’t travel straight if I do that.

I tied this code…

…CharacterController controller = (CharacterController)GetComponent(typeof(CharacterController));

…if (!controller.isGrounded)
…this.transform.Translate(Vector3.down * moveSpeed);

However my controller is never Grounded. He passed through the floor.

Apparently changing the transform ignores collision. When I move using CharacterController.Move collision works properly.

Unforutnly .Move does not work will with the manuall move style I have coded. I am sure I will get it ironed out eventually.

To move a Rigidbody with physics, you’d apply force with AddForce. To bring a rigidbody to a certain velocity, you’d add (desiredVelocity - rigidbody.velocity) force.

I personally use ForceMode.Acceleration with some tighter controls on the actual amount of force added, but ForceMode.VelocityChange is a good one if you want to reach that speed instantly.