Hi, i am trying to make a particlesystem(fire) attached to a campfire to be emitted(or change its color at least) when i throw the twig to the campfire, the count is used to count how many twigs are thrown to the campfire,everthing works except the change of color of the particle system fire
public class count : MonoBehaviour {
public int counter;
public Text text;
public Rigidbody fireball;
private ParticleSystem fire;
// Use this for initialization
void Start () {
counter = 0;
text.text = "count: " + counter.ToString();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider other)
{
if(other.CompareTag("twig"))
{
this.GetComponent<ParticleSystem>().startColor = new Color(1, 0, 1, .5f);
other.gameObject.SetActive(false);
counter++;
text.text = "count: " + counter.ToString();
}
}
}