Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Hi my animation not working . i think it is because of animator ..please help @LatchGameDev

$
0
0
using System.Collections; using System.Collections.Generic; using UnityEngine; public class DamageEnemy : MonoBehaviour { // Start is called before the first frame update [SerializeField] int EnemyHealth = 100; private AudioSource MyPlayer; [SerializeField] AudioSource StabPlayer; private bool HasDied = false; private Animator Anim; void Start() { MyPlayer = GetComponent(); Anim.GetComponentInParent(); } // Update is called once per frame void Update() { if (EnemyHealth <= 0) { Debug.Log("hahahahah"); if (HasDied == false) { Anim.SetTrigger("Death"); HasDied = true; } } } private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Axe")) { EnemyHealth -= 50; MyPlayer.Play(); StabPlayer.Play(); } } } ......... @LatchGameDev

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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