public GameObject RIPEnemigo;
void Rekt()
{
GameObject RIP = (GameObject)Instantiate(RIPEnemy, transform.position, transform.rotation); //Instantiate of the particles
Destroy(gameObject); //Destroys enemy
Destroy(RIP, 2f); //Destroys particles
}
I added the particles prefab and everything in the inspector is OK, but it says:
UnassignedReferenceException: The variable RIPEnemy of Bullet has not been assigned
You probably need to assign the RIPEnemy variable of the Bullet script in the inspector.
RIPEnemy is a particle effect
Why? It's easy, when enemy gets hit -> particles -> RIP Enemy -> RIP Particles. I've searched in the forum but I don't understand where's my error
RIPEnemy? Have you looked in the inspector and ensured you dragged a GameObject onto it?Instantiate. Something likeRIPEnemy = new ParticleEffect();(or whatever that type happens to be). Without a stack trace as well as what actual typeRIPEnemyis though no one here can answer that for you.RIPEnemy, notRIPEnemigo, right? Otherwise that is a problem.