- Home /
Ability Feedback - How should I set this up
So I want my character's abilities to trigger animations on separate game objects. What I've tried doesn't work and even if it did, it feels like an awfully clunky way of doing it. Suggestions would be super appreciated <3
What I've tried so far is the following (pseudocode):
public GameObject pFeedback;
private Animator pAnimator;
Start () { pAnimator = pFeedback.GetComponent(); }
Update () { pAnimator.SetTrigger("Trigger"); }
Please use real code in your question, and the code formatting tool.
Answer by lgarczyn · Dec 22, 2019 at 07:00 PM
The easiest way to do this is to have public Animator variables on your player script, in which you drag and drop the appropriate gameobjects you want to animate.
Then, simply call SetTrigger on these variables as you are doing right now.
Your answer
![](https://koobas.hobune.stream/wayback/20220612220501im_/https://answers.unity.com/themes/thub/images/avi.jpg)