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

Animation die

$
0
0
hello, im new to unity3d and im having trouble with the "die" animation. i can't seem to get it work. Here is my script: public int health = 100; public TextMesh tm; public AnimationClip dead; void Start () { tm = GetComponentInChildren (); } // Update is called once per frame void Update () { tm.text = "Health : " + health.ToString(); if (health<0) { health = 0; GetComponent().Play(dead.name); } } public void GetHit(int damage) { if(health <= 0) { Destroy(this.gameObject); } health -= damage; } } Anyone know how to fix it?

Viewing all articles
Browse latest Browse all 115

Trending Articles



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