Hi,
Thanks for reading. I’m having some trouble getting a particle system (A) to activate when a character receives a buff. This is strange, because each character has a separate, but functionally identical particle system (B) attached. Unless I set particle system A to play on awake it will not show at all. I’ve also discovered that while I can switch it off, I can’t switch the particles on. Any help greatly appreciated!
Here’s a screen grab of the settings:
Here’s the code I’m using to switch it on and off:
using UnityEngine;
using System.Collections;
public class ParticleCommandBuffScript : MonoBehaviour
{
// FIELDS
private ParticleSystem partSystem;
public bool showingCommandBuff = false;
// MONO METHODS
// Use this for initialization
void Start ()
{
partSystem = gameObject.GetComponent<ParticleSystem>();
if(partSystem == null)
{
Debug.Log("ParticleCommandBuffScript.Start(): Command buff particle system is null");
}
else
{
Debug.Log("ParticleCommandBuffScript.Start(): Command buff particle system is not null");
}
}
// CLASS METHODS
// Switches on particle emissions
public void SwitchOnParticles()
{
partSystem.enableEmission = true;
}
// Switches off particle emissions
public void SwitchOffParticles()
{
partSystem.enableEmission = false;
}
}