Hi all,
I’m doing some tests on a 2D project and atm I found 2 problems:
Problem 1:
I created a sprite animation of the jump, but now I see that if I jump off a platform higher than the standard jump the animation restart. How I can adjust the timing of the animation automatically take the jump duration? I can do this in one animation or I’ve to split the animation in 3 trunks: ascending time animation, max jump standing animation, falling time animation?
Problem 2:
I use a simple way to jump:
- In the player object I’ve got a collider that chenge the value of a variable (called grounded) to true of false;
- In the player I’ve got a C# code that in the Update() check if the player is grounded and if the key pressed is “Jump” and then apply some force to the player rigidbody;
(the source I followed was this: Unity 5 2D Platformer Tutorial - Part 4 - Jumping and Ground Check fixing. - YouTube)
The problem is that if I spam the Jump key it happens that sometimes the player jump higher than the usual. I found this:
And I think that is the problem as mine but I wanto to know if the rigidbody+kinematic thing is the right solution for this.
Problem 3:
As everyone I found the problem when I jump near a wall, keep pressing directional key, and the player stick to the wall. I created the non-frictional material, added to the wall and all is ok BUT the obviously problem is that the player if run over the top side of the square that make a wall the friction is 0 so I’ve to ease the speed: is this the only solution? Or I’ve to use two kind of square object: one for vertical walls (with no-frictional material) and one for the ground (without no-frictional material)?
Thanks in advance