Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Particle effect before spawn enemy

$
0
0
Hello, i want to made a dual stick shooter game. what I would try to do is that before the spawn was created a small particle. But I have no idea how to do. This is the script that i use for the enemy spawn public class enemySpawner : MonoBehaviour { public GameObject enemyType; public float spawnRadius = 10.0f; public float spawnDelay = 0.7f; void Start () { Invoke ("SpawnEnemy",spawnDelay); } void SpawnEnemy () { //Vector3 spawnPosition = transform.position + ((Vector3)Random.insideUnitCircle).normalized * spawnRadius; Vector3 spawnPosition = new Vector3 (Random.Range (-17,18),Random.Range (-10,-8),0); Instantiate (enemyType, spawnPosition, enemyType.transform.rotation); Invoke ("SpawnEnemy", spawnDelay); } void OnDrawGizmosSelected () { Gizmos.DrawWireSphere (transform.position, spawnRadius); } } thanks for the help!!

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>