In my game I need to have a first person controller with a rigidbody attached. The rigidbody must have “Use Gravity” enabled.
The only problem is that the Player falls through the floor when I am doing this.
Any solutions?
In my game I need to have a first person controller with a rigidbody attached. The rigidbody must have “Use Gravity” enabled.
The only problem is that the Player falls through the floor when I am doing this.
Any solutions?
Did you add a collider to the player object?
This
Even with a rigidbody you still need some sort of collider.
Try using a capsule collider like you would a charactercontroller.
Yes I have tried that. HAs no one ver tried putting a capsule collider on the default first person controller? Do it. You’ll see that you can barely move because of the collider.
[QUote"420BlazeIt, post: 1924198, member: 671432"]Yes I have tried that. HAs no one ver tried putting a capsule collider on the default first person controller? Do it. You’ll see that you can barely move because of the collider.[/QUOTE]
Youre not getting it.
I didn’t say use the default one
And if you just thought you would stick a rigid body on ythe default fps controller that is where your problem lies.
A character needs a collider whether its a rigid body or a character controller or you’re going to fall through the ground because nothing is colliding with the ground or floor to prevent that.
If you want a rigidbody based first person controller, you have to write your own. You can’t just take any controller and add a rigidbody to it.
Beware though, writing a physics based controller is easy, writing a good one is hard. It took me many weeks and a couple of different approaches before I finally found a suitable way of implementing it.
The scripts from the wiki all use the wrong approach and completely break physical interaction between the player and other objects.
There is a # RigidBody First Person Controller in unity, I guess it’s like a prefab. It kinda works off the bat, but by default it’s unusable. I don’t yet know why it behaves the way it does.
This prefab attaches a RigidBody + Capsule Collider + Rigid Body First Person Controller (script).
It exhibits everything you might need, such as moving about, jumping and falling. But it suffers from various issues, such as not being able to move, sliding across the ground and not being able to stop, jumping tens of meters in the air, jerky movement, poor response.