Hello
iam making a jump set but the add force2d practically teleports the player up... I think this has something to do with the image settings iam using pixels per unit 32.
i have to use force2d 9000 and RB gravity scale of 45 to make him fall at a normal speed.
Is there a way to make him do a jump using Key down/button down ? In my previous script i was using axisraw vertical this was wrong he kept jumping with the arrow up pressed...
iam trying to make it work this way but using button down.
public float vertical;
public float jumpForce;
void Update()
{
vertical = Input.GetAxisRaw("Vertical");
}
void FixedUpdate()
{
Jump();
}
//-----------------jump-----------------------------------------
void Jump(){
if (grounded && anim.GetLayerWeight(2) == 1){
rB.velocity = new Vector2(rB.velocity.x, vertical * jumpForce - 3);
}
else if (grounded && anim.GetLayerWeight(2) == 0){
rB.velocity = new Vector2(rB.velocity.x, vertical * jumpForce);
}
}