So yeah. Maybe its just me thats tired or something. But in this code i’ve made here there is a wierd error(null reference exeption).
`public function Slash(){
var hit: RaycastHit2D = Physics2D.Raycast(transform.position, facingDir, SlashRange);
if(hit.transform.tag == "Enemy"){ //I cant attack when the raycast doesnt hit anything....
Debug.Log("I hit the enemy");
}else{
Debug.Log("Didnt hit anything....");
}
anim.SetTrigger("Slash");
yield(WaitForSeconds(AttackTime));
anim.SetTrigger("Continue");
}
Please help.