Skip to content

Commit b6fa39e

Browse files
authored
Create Animation_Triggers
1 parent 8b6bc9a commit b6fa39e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Animation_Triggers

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class Animation_Triggers : MonoBehaviour
6+
{
7+
[SerializeField] private Animator myAnimationController;
8+
9+
private void OnTriggerEnter (Collider other)
10+
{
11+
if (other.CompareTag("Player"))
12+
{ //ADD YOUR PARAMETERS THERE TO PLAY ANIMATION
13+
myAnimationController. SetBool("YOUR PARAMETERS", true);
14+
}
15+
}
16+
17+
private void OnTriggerExit (Collider other)
18+
{
19+
if (other.CompareTag("Player"))
20+
{
21+
myAnimationController.SetBool("playSpin2", false);
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)