Newer
Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArrowSpawner : StateMachineBehaviour
{
[SerializeField] GameObject arrowPrefab;
GameObject arrow;
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if (stateInfo.IsName("shoot"))
{
Debug.Log("Spawn Arrow");
arrow = Instantiate(arrowPrefab,animator.gameObject.transform.position,Quaternion.identity);
}
}
}