This is my first try to make coding so I think I have done something real stupid here… This is what it should do:
When the enemy hits the player it makes boolean IsClose True which means enemy starts doing his attack animation. It just don’t activate the boolean ![]()
using UnityEngine;
using System.Collections;
public class animatioon: MonoBehaviour
{
Animator animator;
// Use this for initialization
void Start()
{
animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
}
void OnCollisionEnter(Collision col)
{
if (col.gameObject.CompareTag("Player"))
{
animator.SetBool("IsClose", true);
}
}
}