Question by
mudabbirali92 · May 17, 2019 at 09:57 AM ·
unity 2djumpingwall
How can i make a parabolic jump while jumping between walls. I have to jump between walls while tapping just space bar button and player should jump between walls going higher and higher.
// detecting that my player is stick to wall and slightly sliding down.......
if (isWallSliding && hoppingWallCheckHit && !isGrounded)
{
extraJumpes--;
//now when I press spce button player should jump from one wall to another........
if (Input.GetKeyDown (KeyCode.Space))
{
//what should i write here to make a parabolic jump for my player???
}
}
Comment
Answer by tormentoarmagedoom · May 17, 2019 at 10:33 AM
Hello.
For a good parabolic trajectory, you need to apply a movement to the object. This movement must have at least 2 components.
One component of the vecotr must change constant over time, i mean move same amout of distance every frame.
The second component must follow a mathf.sin value.
Check this tutorail Titled: Moving Object Along A Parabola - Unity Tutorial
Bye!
Your answer
Follow this Question
Related Questions
RiigidBody2D.AddForce() isnt working at all. 0 Answers
Cant double jump with grounded code,Being grounded and Double Jumping 0 Answers
Unity 2D Enemy jump Question (Frog jump) 1 Answer
Jump Script in Unity 2D,I need help with jump script unity 2d 0 Answers
2D game jumping stopped working when I added lighting 0 Answers