void OnTriggerEnter2D(Collider2D coll)
{
if (coll.gameObject.name == "лестница")
{
print("ударился");
if(Input.GetKeyDown(KeyCode.W)){
moveVector.y = Input.GetAxis("Vertical");
rb.velocity = new Vector2(moveVector.x, moveVector.y * speed);
}
}
}
private void OnTriggerStay2D(Collider2D collision)
{
if(Input.GetKeyDown(KeyCode.W)){
moveVector.y = Input.GetAxis("Vertical");
rb.velocity = new Vector2(moveVector.x, moveVector.y * speed);
}
}