Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

I need help

Discussion in 'Scripting' started by MrM33seeks, Apr 13, 2020.

  1. MrM33seeks

    MrM33seeks

    Joined:
    Apr 13, 2020
    Posts:
    3
    I just started unity and I'm trying to make movement controls but when I go to play my character doesn't move. I'm following a tutorial and I can't find where I messed up pls help.

    upload_2020-4-13_14-31-14.png
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Are you getting any console errors?
    Do you have a rigidbody on the character?
    Do you have a CharacterController on the character? (you are using rigidbody movement, so you should not have a CharacterController, if you do you need to use that to move the character, not the rigidbody)

    You are getting input in FixedUpdate. Don't do that. Get input in Update, and add the forces in FixedUpdate. (edit: this will cause intermittent missed inputs, but won't explain why it doesn't work entirely)

    Verify the values for the public floats in the inspector. Try some larger forces, as you may just be getting friction or drag overpowering the force. Make sure you have the rigidbody set with the correct settings as well.
     
    PraetorBlue likes this.
  3. MrM33seeks

    MrM33seeks

    Joined:
    Apr 13, 2020
    Posts:
    3
    No console errors, I have rigidbody on the player. no CharacterController( I don't know if i should). I changed FixedUpdate to Update. I put physics material on the ground to erase the friction. I still don't know what to do but thanks for the help.
     
  4. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Have you assigned the rigidbody in the inspector ?
     
    Joe-Censored and PraetorBlue like this.
  5. MrM33seeks

    MrM33seeks

    Joined:
    Apr 13, 2020
    Posts:
    3
    I assinged rigidbody to the movement script.
     
  6. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    In the inspector, what are the values assigned to "sidewaysForce", "forewardForce", and "upwardForce"?
     
    Joe-Censored likes this.