Fully controllable physics object - how?

Hey guys,

I need an object that is fully controllable by script regarding movement but still has collision so it’s not able to move through walls.

The CharacterController is not bad for my needs but I need another shape. Unfortunately the vertical CapsuleController isn’t applicable for me…

Any suggestions?

Have you tried a kinematic rigidbody?

Make sure your game object has the necessary collider(s) attached. Then add a Rigidbody component to your game object and set IsKinematic to true. The resulting game object will be fully controllable through scripting and will push other rigidbodies, though you might have to use collision detection to keep it from going through stationary objects.

Another option would be to use a non-kinematic rigidbody and move it by applying forces/torque to it.

Yep, I’m currently going this way. However the collision detection has to be done manually and also pushing other “enemies”, that use the same system as the player, has to be done manually.

Anyway, it almost works excellent… with some tweeking here and there.