// Start is called before the first frame update void Awake() { nma = GetComponent <NavMeshAgent>(); fra = GetComponent <ForceRegionAcceptor>(); StartIdling(); }
private void OnTriggerStay(Collider collision) { ForceRegionAcceptor fRA = collision.gameObject.GetComponent <ForceRegionAcceptor>(); if (!fRA) { return; } Rigidbody rb = collision.gameObject.GetComponent <Rigidbody>(); rb.AddForce(transform.up * force_Strength * fRA.forceRatio); }
void Start() { nma = GetComponent <NavMeshAgent>(); fra = GetComponent <ForceRegionAcceptor>(); }