Character falling over problem

ok so im using a rigidbody for “player” but when walking around “player” keeps falling over like its a ragdoll how do i go about keeping this from happening

2 Likes

If you select this player of yours and look in the inspector. Under the rigidbody component you’ll see a dropdown menu titled “Constraints”.

You want to at least freeze the X and Z rotation. This will keep you character from falling over.
I usually freeze the Y rotation as well, cause then the rigidbody won’t rotate unexpectedly. :slight_smile:

40 Likes

Have you checked the isKinematic option? Use this if you want to control the object via script, but let it interact with physics

7 Likes

thank you guys :slight_smile: i was thinkin of using the freeze axis just wasnt sure how :smile:

i had the same problem with my zombies then i found your coment and omg thank you i love you so much now all i need is a zombie modle

Awesome, was having so many problems with models tipping over and this is a simple fix.

thank you sir, that was my problem, you are great!

Thanks! I was looking for this!

Thanku so much now its working as i want

mine only has a freeze z?

What if you want to implement an impact falling?

Let’s say your model is badly balances and it tips over if x rotation unlocked. Now, I shoot it with a projectile, and it will only move by impact, but never fall.

You can change the constraints at any time using code, so in the code that you are using to handle the projectile impact on the enemy you can just turn the constraints off.

1 Like

this was a simple fix thanks

I did this but now my character can move through colliders on the x axis is there a way to fix this

1 Like

hello! good am/pm, I’m am beginner in unity and i have a bit some issue when i check everything under rigidbody X,Y and Z in “Freeze rotation” my jump script wont work and when the “Player” or “Character” collides on a cube it keeps tripping like a “ragdoll” and i don’t want it to be like that, Is there way that it will be able to be fix? Thank you

Came here wondering what 23k views was about to find a necro :frowning:

If you’re having some problem with a script then you should always post a new thread in the scripting forum. Copy your script into the post using the “Insert Code” button at the top of the editor.

Oh okay,Thanks!

I use photon pun for online game.but photon view script added to player it
falling down IT do not colide the ground.