UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"control gravity, enable and disable included in methods"
using UnityEngine; public class GravityRouter : MonoBehaviour { public CapsuleCollider gravityCollider; void Start(){ gravityCollider.enabled = false; } void OnTriggerExit(Collider other) { gravityCollider.enabled = false; } void OnTriggerStay(Collider other) { gravityCollider.enabled = true; PlayerBody playerBody = other.GetComponent<PlayerBody> (); RaycastHit surfaceDown; if (playerBody