void FixedUpdate() { touchingRight = wallSensorRight.IsWallCollide(); touchingLeft = wallSensorLeft.IsWallCollide(); if (jump) { //body.AddForce(transform.up * jumpForce, ForceMode2D.Impulse); body.velocity = new Vector2(body.velocity.x, jumpSpeed); jump = false; StartCoroutine(JumpInterval()); } }
private bool isTouchingWall() { return(leftWallSensor.IsWallCollide() || rightWallSensor.IsWallCollide()); }
public bool isOnWall() { return(wallSensorLeft.IsWallCollide() || wallSensorRight.IsWallCollide()); }