Sorry if this is in the wrong section.
Anyways,
So I just completed the Roll-A-Ball tut.
Now I’m trying to add particle effects on the pickups.
The problem is… I cant get anything to work. I’ve tried looking this up but I can’t find anything that works?..
Heres my code which is suppose to activate it every time the player collides, however this isn’t giving me any results…
using UnityEngine;
using System.Collections;
public class ParticleEmitter : MonoBehaviour
{
public ParticleSystem exp;
void OnTriggerEnter (Collider col)
{
if (col.gameObject.CompareTag ("Player"))
{
Debug.Log (" I should be emitting paritcles");
Explode ();
}
}
void Explode()
{
exp = GetComponent<ParticleSystem> ();
exp.Play ();
}
}
Warning: [quote]
The referenced script on this Behaviour (Game Object ‘Pickup’) is missing!
[/quote]
I have a particle system on ever pickup. I tried making it so it spawns the particle effect on that pick up with instantiate, however that wouldn’t work either.
I even tried making the particles massive just in case it was too small. And yes, I’ve hit “Apply” every time I put something on one of the pickups. The pickups are all under 1 prefab, just as in the tut.
Can someone please help me? This is very frustrating, I feel like it’s a lot easier than what I’m making it out to be