my unity engine doest have SetTrigger

Hey everybody, i want ask your help for a little problem i have, i was setting up an animation and my Unity Enginge doesnt recognized SetTrigger, can any1 help me out here plz??

7076956--841849--upload_2021-4-25_23-52-9.png

Thanks in advance

Regards!

The problem is in your declaration of “animator”. It’s not shown above, but we can tell from the error message that it is an Animation, not an Animator.

thanks!!! i ll try that

Hey, i tried but didnt work, animator is a function i created,

7084999--843292--upload_2021-4-28_0-43-28.png

i tried Animation.Settrigger and got an error anyway :frowning:

7084999--843289--upload_2021-4-28_0-43-7.png

Cant understand why i doesnt work, plz help!

To be blunt you’re trying to use a language without understanding how to use the language.

No. It’s an instance of a class.

There are two problems here. One, like @JoeStrout mentioned it’s the wrong class. Two, you’re trying to call the method of the class directly when you should be calling it through the instance.

You need to change this:

private Animation animator;

To this:

private Animator animator;

Then you need to change this:

Animation.SetTrigger

To this:

animator.SetTrigger
3 Likes

cool thank u very much

it work thank you very much