Quantcast
Channel: Questions in topic: "help me"
Viewing all articles
Browse latest Browse all 115

I want this script to destroy the enemy

$
0
0
using UnityEngine; using System.Collections; public class death : MonoBehaviour { Transform curTransform; void Start(){ curTransform = gameObject.GetComponent(); curTransform = gameObject.transform; } void Update(){ EnemyHealth eh = gameObject.GetComponent(); eh.GetComponent(); eh.health = 0; } GameObject Wolf_run; void Updatetwo(){ Destroy(gameObject); } } the script does not do anything when the enemy reaches 0 health I want the enemy to be destroyed when it reaches zero health. im very new to coding

Viewing all articles
Browse latest Browse all 115

Trending Articles



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