OnTriggerStay(Collider)
Called once per physics update for every collider that is touching the trigger.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
OnTriggerStay()
public void OnTriggerStay(Collider collider)
Parameters
Remarks
OnTriggerStayOnTriggerEnterExamples
// Applies an upwards force to all rigidbodies that enter the trigger.using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void OnTriggerStay(Collider other) { if (other.attachedRigidbody) { other.attachedRigidbody.AddForce(Vector3.up * 10); } }}