Really NEED help about Animation
There is a guy answered my question he give me a script here is the script about animation I need my tower to play its animation when enemy spawn.. My tower has a animation already all i need is to play its animation when it fires if enemy is near to the range
using UnityEngine; using System.Collections;
public class Attack : MonoBehaviour {
void OnTriggerEnter(Collider Obj) { if (Obj.tag == "Enemy") { gameObject.GetComponent().Play("ATTACK"); } } }
But when the Enemy (tag as Enemy) pass through the box with box collider is Trigger My tower won't play the animation which is ATTACK..
Need Help PRO out there please
Answer by avazutaev · Mar 06, 2017 at 03:52 PM
Try this:
gameObject.GetComponent<Animator>().Play("ATTACK");
Your answer

Follow this Question
Related Questions
Trigger the Animation #2 after Animation #1 was triggered 0 Answers
Help with a door slam trap 0 Answers
I want my character to enter and exit car with animation 1 Answer
Vuforia (AR) Play animation on Target Image found (SCRIPT Help) 0 Answers
I am trying to get my player to trigger an animation brought over from Maya 0 Answers