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

Is there a piece of code that could make enemies spawn in after one has been clicked on and destroyed?

$
0
0
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Animations; using UnityEngine.Audio; public class Click : MonoBehaviour { public GameObject gameCharacter; public Animator anim; // Start is called before the first frame update void Start() { anim = GetComponent(); } // Update is called once per frame void OnMouseDown() { anim.Play("stickDeath"); Destroy(gameCharacter, 1.5f); } } this is my code, is there a way to have the enemies spawn in random spots inside the cameras parameters after one of them has been destroyed?

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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