Hello all – I’m really new to Unity, and have been poking around. I was just wondering what the easiest way was to allow the FPS Controller package be able to push RigidBodies around. I have tried adding a RigidBody and Capsule Collider to the Graphics instance, but it just falls over and rolls around helplessly.
Any help greatly appreciated!
The character controller can’t really interface with rigidbodies. I bet you could make a script that allows you to grab and move regular or physics objects.
Can’t you just parent an empty game object to it and attach a kinematic rigid body to it? Or parent a mesh in whatever shape with a collider and RB but kill the mesh renderer? Never tried it…
EDIT: that would just work for walking and knocking things like garbage cans over or pushing pop cans, not quite sure what you want to do.
-Jeremy
I’m also having trouble with this. If I remember correctly an old version of the first person controller pushed other objects just fine. Is it because the FPS controller uses transforms instead of physical forces?
The FPS prefab that ships with Unity is a CharacterController.
The character controller is a very unphysical component. That is, it only handles collision detection like quake 3 does.
If you think about it, first person controllers are not based on physics. In quake you run at 90 miles per hour, turn on a dime and stop completely in one frame.
A rigidbody can not do this because it simply isn’t physics you are trying to achieve.
Older versions of Unity used a rigidbody based First person controller and i am sure you can find the scripts somewhere in the forum archives. It is still useful for cases where you want your character to also be affected by forces automatically.
If you want a more traditional quake style controller but want to affect other objects just apply forces manually. The CharacterController documentation describes how to do that here: