The parent of turret pivot (Stryker) has an animator attached that has 1 animation that rotates the turret from left to right. I want to move the object using a script after the animation has played, but for some reason, I cannot seem to move it even after the animation has played. I tried adding an empty state after the aim transition but still no luck. I am just trying to clear my basics please help.
Here is the code that I am using to move the turret.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TankAim : MonoBehaviour {
public GameObject tankPivot;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if(Input.GetKey(KeyCode.A))
{
tankPivot.transform.Rotate(new Vector3(0, 1, 0));
}
}
}