void OnTriggerEnter(Collider other) { if (other.CompareTag("Edge")) { gripScript.hangPos = new Vector3(player.transform.position.x, other.transform.position.y, player.transform.position.z); gripScript.Hang(); gripScript.hanging = true; playerScript.AnimState("hang"); } else if (other.CompareTag("DroneEdge")) { gripScript.hangPos = new Vector3(other.transform.position.x, other.transform.position.y, other.transform.position.z); gripScript.Hang(); gripScript.hanging = true; gripScript.droneHang = true; playerScript.AnimState("hang"); } else if (other.CompareTag("Wall")) { climbScript.Climb(); } else if (other.CompareTag("WinCube")) { playerScript.win = true; } }
void Update() { if (hanging) { if (droneHang) { playerScript.transform.position = new Vector3(hangPos.x, hangPos.y - hangOffset, hangPos.z); } if (playerScript.playerInput.jump) { StopHang(); playerScript.playerRB.AddForce(Vector3.up * jumpUpForce); playerScript.AnimState("jump"); } if (playerScript.playerInput.shift) { StopHang(); playerScript.AnimState("falling"); } } }