- Home /
Player cant fall down
Hello. I am making my first game and i have few problems First one is my movement:
float h = Input.GetAxis ("Horizontal");
float v = Input.GetAxis ("Vertical");
transform.Rotate (0f, h * rotates, 0f);
if (Input.GetKey (KeyCode.W) || Input.GetKey (KeyCode.UpArrow))
{
rb.velocity = transform.forward * speed;
}
if (Input.GetKey (KeyCode.S) || Input.GetKey (KeyCode.DownArrow))
{
rb.velocity = transform.forward * -speed;
}
Can i improve my moving forward and backward without using IF loop? Second one: It is hard to describe. So when i press play button and W/UpArrow I start moving on ground y=0. Later when i will go on ramp 30* slope and the highest point on y=10and want to jump (actually slide off) from that ramp I should fall down like a brick, but I start fly on that y=10 and fall down a really REALLY slowly. When i stop moving i will fall like every thing on Earth.
I hope you can help me. Oh and sorry for my gramma.
Your answer
![](https://koobas.hobune.stream/wayback/20220613200716im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
My character fall down on the ground ? 1 Answer
Top-Down Shooter Motion 2 Answers
How can i move a game object up and down so it acts like a obstacle for my sphere player 4 Answers
Fall through the floor after entering a trigger? 2 Answers
Bullets fall 4 Answers