- Home /
CharacterController and Physics!
Hey.
I would like to know if there is any way to give a CharacterController same Physics like a rigidbody. What I especially like to know how to give the CharacterController a rotation if moving onto a mountain. Is the rigidbody the only solution?
Thanks for each answer ;)
Answer by RealMTG · Dec 07, 2014 at 05:33 PM
I don't know if I am to much help but I would go for a Rigidbody player. The CharacterController is not really that great when it comes to physics. If you do want physics for the CC you have to code them yourself. If you want a finished rigidbody player, get sample assets from the assets store. https://www.assetstore.unity3d.com/en/#!/content/14474 It is made by the Unity guys and it is free. It is really great and you can probably make your own controller if you just take a look at the player controller scripts in the asset.
Sorry if this wasn't what you are looking for but it is just a tip.
thank's for that. I'll have a look at it. Finally that means, that you prefer a Rigidbody? Damn.. I started with a CC's for players... finally there causes a problem, because Rigidbody's don't interact with CC's... but thank's for the advice ;)
I think the sample asset has a CC using rigidbody. not sure though
yes. As I can see there is just a Rigidbody. But the controll is such awesome ;) hahah nice tip. It looks like that I have to remove the CC's and make a configuration for Rigidbody based on this project... Finally it's sure that a CC has no adventages?
I would like to hear more opinions...
The only advantage I can see from the CC is the step height which is REALLY good for stairs and such. The rigidbody doesn't have that implemented but can be implemented. I don't know how honestly but it can be done.
Answer by Pflobus · Dec 07, 2014 at 06:01 PM
I think you probably just need a rigidbody. Maybe lower the mass to it won't fall off whatever it is, but that should work. Except that all controllers, at least in first person, come with a built-in rigidbody.
But if it's in 3rd person, same may work, but I am not sure.
The FPS controller does not have a rigidbody as standard. It can be added but is not there by default. However the FPS controller script auto corrects rotation weather there is a rigidbody or not.
You can make it run in FixedUpdate() with a rigidbody but you then have the camera moving in relation to this and it tends to cause judder. So the Camera script needs rewriting to sort out this new problem.
You can also add a bit of script to the FPS Controller that will make it interact with physical objects, but this too is prone to glitches as it is running in Update().
The better solution here by far is what Real$$anonymous$$TG(+1) is suggesting above.