when i collect the shield the animation has entry to animation it play when gameObject is active when the game is playing but i have create a clip on the same gameObject which indicate shield taking hit now i define a parameter when shield get hit to play when OnShieldHit is trigegered but I dont know How to set this on controller window
You haven’t given much information here, but to make the animation switch,
You just add the Animator Component to an object and assign the controller:
⠀

⠀
You then need the script to have a reference to the Animator component and Set the Trigger:
⠀
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MyNewScript: MonoBehaviour
{
Animator anim;
// Awake will be called when the object is instantiated
public void Awake()
{
anim = GetComponent<Animator>();
}
// Call this function to set your trigger
public void ShieldHitAnim()
{
anim.SetTrigger("OnShieldHit");
}
// Just as an example, this would run the animation when you hit a trigger Collider (Assuming this game is 2D)
protected void OnTriggerEnter2D(Collider2D other)
{
ShieldHitAnim();
}
}
