UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"clear the area in the game"
public class AreaClearance : MonoBehaviour { public float lastTriggerTime = 0f; private bool areaClear = false; void Update () { lastTriggerTime += Time.deltaTime; if lastTriggerTime > 1f && Time.realtimeSinceStartup > 10f && !foundClearArea) { SendMessageUpwards ("OnFindClearArea"); areaClear = true; } } void OnTriggerStay (Collider collider) { if (collider.tag != "Player") { lastTriggerTime = 0f; } } }