How to check if Animator is playing

Updated on September 6, 2017 in [A] Animation
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on September 6, 2017

How can I check if my Animation is playing in my Animator? By the way, my animation is called Lava_Burst.

 

____________________________________________________________________________

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

 

public class Indingo_Lava_Burst_Activator_Deactivator : MonoBehaviour
{

 

private PolygonCollider2D myPolygonCollider2D;

 

private Animator myAnimator;

 

private bool lava_burst;

 

private Rigidbody2D MyRigidbody;

 

private Indingo_Movement indingoMovement;

 

private Indingo_Jump_01 indingoJump01;

 

private Indingo_Jump_02 indingoJump02;

 

// Use this for initialization
void Start()
{
myPolygonCollider2D = GetComponent();
myPolygonCollider2D.enabled = false;
myAnimator = GetComponent();
MyRigidbody = GetComponent();
indingoMovement = GetComponent();
indingoJump01 = GetComponent();
indingoJump02 = GetComponent();
}

 

// Update is called once per frame
void FixedUpdate()
{
if (Input.GetKey(KeyCode.G))
{
myAnimator.SetBool(“lava_burst”, true);
myPolygonCollider2D.enabled = true;
indingoMovement.enabled = false;
indingoJump01.enabled = false;
indingoJump02.enabled = false;
}
else
{
myAnimator.SetBool(“lava_burst”, false);
myPolygonCollider2D.enabled = false;
indingoMovement.enabled = true;
indingoJump01.enabled = true;
indingoJump02.enabled = true;
}

 

if (MyRigidbody.velocity != Vector2.zero)
{

 

myPolygonCollider2D.enabled = false;
Debug.Log (“Player Is Moving”);

 

}
}
}

 

 

 

  • Liked by
Reply
0 on September 6, 2017

Google…

  • Liked by
Reply
Cancel
0 on September 6, 2017

Tried that. Couldn’t find any help that supported my Script. Plz just answer my question

  • Liked by
Reply
Cancel