Hey guys, I've got this plane with a working animated tiled texture which looks great, and the sequence it self is a hit spark (to show when something is hit). What I would like to do is make it so that whenever my spawned enemy is hit by the player's sword, the hitspark is created and stays on screen for 1 second. The problem is that since the enemy is spawned, it can't have a prefab to connect to the hitspark. Could anyone give me a hand?
Here's where the call to create the spark should go:
function OnTriggerEnter(hit : Collider)
{
if(hit.gameObject.tag == "Sword" && Walker.hitTimeSmall == true)
{
//////Insert Hitspark here!//////
Walker.hitTimeSmall = false;
health -= 1;
beingHit = true;
animation.CrossFade("gethit");
}
}