Thank you for the welcome ahahahhahaha
i have only one last question, in the last script you sent , could you jump on top of the ladders? cause right now it seems i cannot anymore and i don’t know if i moved something i shouldn’t hahaahha
update: ok it seemed that the gravityscale of the line where we checked for mathf.approx was “overriding” the gravity when i was trying to jump so i modified it and added a check for “if you are also NOT pushing space”
private void CheckIfClimbing()
{
if(((!Mathf.Approximately(vAxis, 0) && onLadder) || onLadderTop) &&!checkjump)
{
isClimbing = true;
rb.gravityScale = 0;
} else if (!onLadder)
{
isClimbing = false;
rb.gravityScale = gravityScaleAtStart;
}
}
only flaw is that doing so when i jump from top it will stay with gravity to not 0 unless i press UP again …but i have to say i like this (and also i not have the energy to trying solve this) i like this because it makes sense to fall if you jump on top of a ladder if you think about it , i’m just trying to convince myself but it’s ok ahhaahahahha
this is my jump
private void Jump()
{
if ((onGround || onLadder) && checkjump)
{
isClimbing = false;
rb.gravityScale = gravityScaleAtStart;
Debug.Log("salto");
rb.velocity = Vector2.zero;
Vector2 jumpVelocityToAdd = new Vector2(0f, jumpSpeed);
rb.velocity += jumpVelocityToAdd;
return;
}