Player can't get on the second floor of the game?

Hello,

I recently started with unity and I really enjoy it, I am working on a small horror game and everything is working perfectly. It is about a person going into a abandonded house and look around for some stuff. The problem came when I wanted the player to go to the second floor. At first I couldn’t make a working staircase. I tried everything from changing the step offset on the FPS control to making a slope. I finally gave up and made a teleport script which teleport the player once he entered a trigger to the end of the stairs on the second level, but once I entered the teleporter I came on the right place but on the ground floor and not the second floor!

That made me wonder why I couldn’t get to the second floor, so I tried to place my first person char to the second floor and hit the play button, when I did that he got again on the first floor?!?!

What is wrong that my player can’t change it’s Y-Axis and has to stay on the first floor?

totalAxes = Mathf.Abs(horizontal) + Mathf.Abs(vertical);
totalAxes = Mathf.Clamp (totalAxes, 0.0, 1.0);
translateChange = totalAxes * translateChange;
transform.localPosition.y = midpoint + translateChange;

This head bobbing script was setting the Y-Axis position directly, which is going to move the character to that position on the Y-Axis.

Try using gravity/physics to determine you’re Y-Axis and you’ll probably clear up your stairs issues.