Question by
imM4TT · Dec 09, 2017 at 01:37 AM ·
animationrotation detection
Trying to apply an animation when player is turning
I search to apply a simple animation when my personnage is turning right. Something wrong there ? using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class Player : MonoBehaviour {
public GameObject player;
private Animator rightAnim;
void Start()
{
rightAnim = player.GetComponent<Animator>();
Debug.Log("1");
}
void Update()
{
if (transform.eulerAngles.x >= 1)
{
rightAnim.GetComponent<Animation>().Play("openAnime");
}
}
Comment
Answer by imM4TT · Dec 09, 2017 at 04:05 PM
I have the animation just when i start the game. That's constantly playing and I didnt move my mouse With the script above
Your answer
Follow this Question
Related Questions
rotation problems 0 Answers
Walking animation javascript? 2 Answers
What's the API call to bypass effect in the AudioMixer? Or a workaround? 1 Answer