Possible to use Rigidbody & Capsule Collider instead of Character Controller?

I was wondering if it was possible to use a rigidbody & capsule collider instead of a character controller for the content of this course. I’m going through this for the second time and wanted to set it up now rather than later, and I’m having trouble figuring out what the equivalent of stateMachine.Controller.Move on the PlayerTestState could be.

I’m trying stateMachine.Rigidbody.MovePosition but it’s just jerking my player character in place.

Set the RigidBody to IsKinematic, but leave UseGravity on.

Then use transform.translate to move the character. Make sure the Capsule Collider is not a trigger.

You’ll find that the ForceReceiver and the RigidBody won’t like each other very much, so you’ll have to use rigidbody.ApplyForce for some of the special effects like knockback and jumping…

1 Like

Thank you! That seems to have fixed it. Will be sure to ask more questions in the future.

Hi! I did some more testing, including adding a Character Controller build. Turns out the Controller.Move function works fine, but when I replace that with a transform.Translate, or a Rigidbody.transform.Translate (and relevant code in the PlayerBaseState), I get some weird movement bugs (it actually moves when I do the Translate method so that was a start, this was the big reason why I got excited over ‘fixing’ it.).

Are there any other Rigidbody methods that could work?

Nothing comes to mind… That’s part of why we did it the way we did.

Privacy & Terms