Question by
ratthadev · Jun 11, 2016 at 04:41 PM ·
2dinstantiateparticlesparticle system
I'm trying to Instantiate particles in 2D game, but it didn't show up.
I'm trying to Instantiate particles in 2D game, but it didn't show up. It show up when I drag and drop it from prefab to workspace.
But when I started game it didn't show up.
See? Particle is spawned but its effect didn't show up, I don't know why. Here, check out my script.
using System.Collections;
public class FireMechanic : MonoBehaviour {
public Renderer rend_f;
public bool ready;
public GameObject FireUp;
// public Vector3 lit;
// Use this for initialization
void Start () {
rend_f = GetComponent<Renderer> ();
rend_f.enabled = false;
// lit = GetComponent<Vector3> ();
}
// Update is called once per frame
void Update () {
if (GameObject.Find ("Wood_Dummy").GetComponent<WoodMechanic_D> ().WoodSet) {
ready = true;
rend_f.enabled = true;
}
}
void OnMouseDown(){
if (ready == true) {
Instantiate (FireUp,transform.position, Quaternion.identity);
print ("lit");
}
}
}
untitled2.png
(32.4 kB)
untitled.png
(488.9 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612082728im_/https://answers.unity.com/themes/thub/images/avi.jpg)