- Home /
How can I get a gameobject to be deactivated and a cube gameobject with a particle Emmitter to activate?
The problem that is occurring is that my public gameObject Fire will not work unless it has a prefab. even with said prefab the object will not go from "Not Activated to Activated" My code is: public class LaserCollision : MonoBehaviour { public GameObject fire; void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("SD")) { other.gameObject.SetActive(false); fire.gameObject.SetActive(true); Debug.Log("boom"); } else { fire.gameObject.SetActive(false); } }
}
If the emitter is a prefab you need to instantiate not enable on this case...
Your answer
Follow this Question
Related Questions
Character controller collider? 0 Answers
Response speed in OnCollisionEnter / OnTriggerEnter 1 Answer
How to detect collision without OnCollisionEnter or OnTriggerEnter? 1 Answer
How to make multiple gameobjects instantiate from one collider? 3 Answers
How do I use an enemy's OnTriggerEnter to collide with stationary player? 2 Answers