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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

FPS Controller Jumping Randomly

Discussion in 'Physics' started by 3dgreg, Jul 24, 2015.

  1. 3dgreg

    3dgreg

    Joined:
    Dec 31, 2014
    Posts:
    68
    The standard asset FPS Controller is jumping on it's own. As soon as I enter the "Play" mode and move either the mouse or keyboard, the Y position axis jumps to 0.98 by itself (from 0.0), and will not come down. As soon as I stop the play mode, it jumps back to 0.0. Is it possible the FPS Controller is corrupt? It doesn't seem to stick to the terrain. Any help would be appreciated, thanks!
     
  2. DerpMerf

    DerpMerf

    Joined:
    Jan 1, 2014
    Posts:
    33
    To be perfectly honest, you probably shouldn't be using the standard asset FPS Controller. There are many much easier ways of creating a First Person Controller. The easiest being to stick the camera inside the character's head. The FPS Controller is most likely not entirely suited to your needs, or you are using it incorrectly, but I do know that Unity did not intend for you to use that actual class in your program. It was more intended for derivation or being a base class for something else. I suggest you have a look at this: https://www.youtube.com/playlist?list=PL3eZfsRk6nF00HSZZJKgZ-HOoz3CJYXJu.
     
  3. 3dgreg

    3dgreg

    Joined:
    Dec 31, 2014
    Posts:
    68
    Thanks, I'll sure look those videos over. It's frustrating because I've had it working in the past now it's no longer co-operating, lol. Oh well, learning as I go.
     
  4. 3dgreg

    3dgreg

    Joined:
    Dec 31, 2014
    Posts:
    68
    Ok, been working with this all morning and here's where I'm at. No disrespect intended. I'm still using the FPS Controller from the Unity Standard asset package. My terrain, my model (a house), and FPS Controller are all set at the same y co-ordinates. As soon as I "Play" and begin any movement, the y co-ordinate jumps to .98. I'm removing the original camera as well. Seems that Unity designed the FPS Controller to work as a standard asset so I'm not sure how I can be using it wrong. I've used this the same in the past and it's worked just fine. I did uninstall Unity 5 and reloaded from a fresh install thinking that was an issue but not. I'll try your "sticking the camera in the characters head trick, but right now there is no character, just FPS Controller camera.
     
  5. DerpMerf

    DerpMerf

    Joined:
    Jan 1, 2014
    Posts:
    33
    Ok, one question. Look at the Rigidbody component in the character, and open the constraints menu. If freezeRotation X and freezeRotation Z are not checked, check them and test. I know that was a huge problem for me, but try that. It might work.
     
  6. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    Hhmmm...

    That is an odd issue, for sure.

    My thoughts are either 1) there's something wrong with the script, 2) there's something wrong with one of you values in the inspector, or 3) you're getting input from somewhere.

    Since you say you did a complete re-install, I'm leaning towards #3.

    Do you have a gamepad connected? If so, try disconnecting it.
     
  7. 3dgreg

    3dgreg

    Joined:
    Dec 31, 2014
    Posts:
    68
    Ok, figured out the issue. I was using a FPS Controller I simply added to the scene. After zooming in on the controller I realized the bottom of the FPS cylinder was touching just below the terrain level. I scaled the FPS cylinder smaller so it wasn't touching the ground and it solved everything. Stupid little error on my part. Apologies to Derp Merf who suggested I was using the FPS wrong. Good news is, I learned a ton of other things while searching out the problem. Thanks for the advice guys!
     
    Not_Sure likes this.
  8. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,541
    Oh, good.