So if object A goes into object B and object A has a trigger to make a bool true, how can I make is so object C knows that it’s true and do something because of it?
Here is a quick example (read the comments)
using UnityEngine;
using System.Collections;
public class ObjectA: MonoBehaviour {
pubic bool b;
void OnTriggerEnter(Collider other)
{
//bool set true
}
}
using UnityEngine;
using System.Collections;
public class ObjectC: MonoBehaviour {
private ObjectA A;//Our other script
void Start(){
A= FindObjectOfType<ObjectA > ();// Get the other script
if(A.b == true){
//Do something
}
}