using UnityEngine;
using System.Collections;
public class flamebreath : MonoBehaviour {
// Use this for initialization
void Start () {
particleSystem.renderer.enabled = false;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.F)){
particleSystem.renderer.enabled = true;
}
if (Input.GetKeyDown (KeyCode.F)){
particleSystem.renderer.enabled = false;
}
}
}
when i press play, the renderer on the particle effect is off, but when i press “F” it doesent turn on.
i removed the line of code in “start” and yes, the fire does spawn, but when i press “F” it disables and doesent turn back on. thanks in advanced!