Hey all,
Got a situation here, wondering if I can get some help. Have a game object emitting particles based on a bool. It should “Play()” when value is true. Problem is, it is doing just the opposite, plays when value is false, and stops when value is true.
public class Flamethrower : MonoBehaviour
{
public float lvl, damage;
public bool fire;
public ParticleSystem flame;
void Start ()
{
}
void OnParticleCollision (GameObject other)
{
Armor armor = other.GetComponent<Armor> ();
if (armor != null)
armor.TakeDamage (damage);
}
void Update ()
{
Debug.Log (fire);
if (fire == true) {
flame.Play ();
}
}
}
even more weird is that i am not calling a Stop(), but it stops on its own as soon as the value is true. What is going on here?