private void OnTriggerStay(Collider other) { if (other.tag == "Ice" || other.tag == "IceWall") { GroundDetected?.Invoke(); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Ice" || other.tag == "IceWall") { Debug.Log("ground entered"); GroundDetected?.Invoke(); } }
private void DetectGround() { if (Physics.Raycast(transform.position, Vector3.down, _detectLength, _groundLayer)) { if (_isGrounded == false) { //Debug.Log("Ground Detected"); GroundDetected?.Invoke(); _isGrounded = true; } } else if (_isGrounded == true) { //Debug.Log("GroundVanished"); GroundVanished?.Invoke(); _isGrounded = false; } }
private void OnTriggerEnter(Collider other) { GroundDetected?.Invoke(); }