Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GorillaLocomotion;
- using UnityEngine;
- public class GorillaGravityZone : MonoBehaviour
- {
- private void Awake() => gameObject.layer = 2;
- private void OnTriggerEnter(Collider other)
- {
- if (other == Player.Instance.bodyCollider)
- {
- Debug.Log("Entered gravity zone");
- Player.Instance.GetComponent<Rigidbody>().useGravity = false;
- }
- }
- private void OnTriggerExit(Collider other)
- {
- if (other == Player.Instance.bodyCollider)
- {
- Debug.Log("Exited gravity zone");
- Player.Instance.GetComponent<Rigidbody>().useGravity = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement