Search Unity

My character just falls down (face plants)/flips over, how do I make it so it doesn't?

Discussion in 'Getting Started' started by DeVoEditor, Dec 1, 2019.

  1. DeVoEditor

    DeVoEditor

    Joined:
    Dec 1, 2019
    Posts:
    2
    I am really new to making video games, I have never attempted to create a video game or coding. I am making a video game for a school project as I really wanted to do a video game as it seemed like a fun project to do.

    I am getting really frustrated as my character falls on the ground on his stomach/back. I don't know how to fix it. If there is anyone who can help me out, that would be awesome, thank you.
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    589
    Hi and welcome @DeVoEditor,

    Give us some details. Maybe a screenshot? Please define what "my character" exactly is? Is it an object you have assigned a CharacterController to, or is it some object with RigidBody to which you try to apply force to move it?
    Take a screenshot of your Inspector area of your object. Otherwise we might be just guessing.

    But I'll make one guess, if your "character" is a GameObject using physics, with a RigidBody and a Collider, you could use Constraints in RigidBody. Lock X and Z, and then your character rotate around those axes, meaning it can only rotate around vertical Y-axis.

    It might be worth watching/reading a few tutorials on the topic of basic character movement in Unity. There's tons of those out there.
     
    BrandyStarbrite likes this.
  3. DeVoEditor

    DeVoEditor

    Joined:
    Dec 1, 2019
    Posts:
    2
    Locking the Z in constraints did it. OMG I love you. You just saved my life, I was getting so frustrated haha. I am sorry for not having that much detail on the problem but it did fix it, thank you so so much.
     
    Olmi likes this.