my rigibody behaves weird
When i press Start in my Scene my Prefab kind of moves up in a very jerky manner.
Before start it's like this:
however when i press Start it kind of jumps upwards. Heres a gif: https://gyazo.com/cdbb7579a9cc60bd6926e03b61c78003
Im confident that its the unit that changes position and not the floor. the y-position increases by about 1.5. The unit also doesnt fall down despite gravity. When trying to move it in the inspector it behaves even more strangely but only on the y-axis.
Here are my settings for that unit:
I have already removed all my scripts and also played around with the rigidbody and character controller settings but nothing worked. Im not sure what else i could try out.
Answer by DenisIsDenis · May 22 at 04:07 AM
Simultaneous use of Capsule Collider
and Character Controller
is not recommended. Also in some cases child objects with colliders can cause similar situations.
⠀
Leave only the Character Controller
and check the child objects.
Hello,
thanks for your answer. Without the Capsule Collider while keeping the same settings otherwise the character just falls through the ground... I can see that the character controller also has some settings regarding Height, Center, Radius, etc. but it does not seem to actually effect collision with the ground etc.
Floor has a box collider witih "is Trigger" turned off.
How do people use the character controller without the capsule collider?
True, your character falls through the floor due to the presence of the Rigidbody
. This component should also be removed. The CharacterController
component allows you to implement character control without any additional components.
Example of using CharacterController
:
https://docs.unity3d.com/ScriptReference/CharacterController.Move.html
Note: There are two types of character control: via the CharacterController
component (simple method) or via Rigidbody
(more complex method). You can find both examples in Unity's Standard Assets:
https://assetstore.unity.com/packages/essentials/asset-packs/standard-assets-for-unity-2018-4-32351