- Home /
Cannot move and jump with rigid body.
So I want my characters movement to be with the rigid body for better collisions. I am simply doing: rb.velocity = Vector3.right speed; and it works well. Also if I do rb.velocity = Vector3.up jumpForce; alone it works. But when i write both of them, they don't work properly. If i remove the movement line the jump works perfectly, if i add the jump line the movement works but the jump start to act weird. I simply want the player to be able to run and jump whenever space is pressed. The game is similar to Mortal Kombat type movement, simply move on sideways and jump whenever.
Hi, Try to use rb.addforce for the jump ins$$anonymous$$d of setting the velocity.
Your answer
Follow this Question
Related Questions
Problems with Physics(Flipping strangely) 2 Answers
Setting a RigidBody's velocity messes with my custom gravity, not sure how to proceed. 0 Answers
Why wont my character jump? (using rigidbody and addForce) 1 Answer
Any way to gracefully detach object with Unity physics? 2 Answers
Rigid body floating the air when I jump at a wall... how do I fix? 2 Answers