Question by
SquareEyesTaco · Oct 31, 2015 at 08:38 PM ·
enemyai
enemy into the air an blow up
i want my enemy to go up into the air for a few seconds then blow up as opposed to as soon as the player touches the enemy he blows up particle effects playing how would i write that?
this is what i have for the enemy
public GameObject FX;
void OnCollisionEnter(Collision collision) {
if (collision.gameObject.tag == "Player") {
Destroy(gameObject);
GameObject o = Instantiate(FX, collision.transform.position, Quaternion.identity) as GameObject;
Debug.Log("OnCollision");
}
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612043449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Enemy AI Script Error 0 Answers
AI walking problem 0 Answers
Basic Enemy follow script for Unity five, desperately needed! 0 Answers