Parameter 'jumpTrigger' does not exist

Hello!

My animation wont transit from FoxRun to FoxJump.

code console

Why is this unity still telling me “Parameter ‘jumpTrigger’ does not exist”?

-Ive made the parameter in animator as seen from pictures.
-I have tried several times to make a new fox prefab from scratch.
-I also tried to use bool instead of trigger (in witch case “parameter ‘bool’ does not exist”).
-tried restarting unity
-animator is on parent, and sprite rendered is on child object.
-I can make animation transition if i click on jumpTrigger parameter manually in animator, but from the script, it looks like “otherObject.GetComponent().SetTrigger(“jumpTrigger”);” isnt doing its job somehow

Ive googled a bit about this issue, and it seems its some kind of a bug, but i wasnt able to find a solution or any sense about what is going on here…

Is there something else i can try to fix this?

Hi Janez,

When exactly does the issue oocur? When you run your game or when you try to do something in Unity?

Did you click on the + to add the trigger to the conditions?

Please double check the spelling of jumpTrigger in the Unity editor. It might be that there is a space behind the name.

If that does not work, rename the trigger. If that’s not possible, create a new one with a different name. Once it works, you could delete the other one and rename the working one to jumpTrigger.

Hey Nina,

Thank you for reply :slight_smile:

Yes, I tried with several parameter types and names…so it was multiple checked.

The problem occurs in play mode when the fox collider hits gravestone collider, and than the OnTriggerEnter2d function gets called (code from the picture above). It can be seen from the “console” picture, that the code is working as it should, until it hits the “SetTrigger” statement. than an error massage occours.

Remove the trigger from the Inspector. See the last screenshot. Then readd it.

If that does not help, remove the Animator component from the fox and readd it.

Is the otherObject really the fox? Log the name into your console.

Ive tried re-adding trigger multiple times, also tried re-adding animator - ive made a whole prefab from scratch about 4 times now - trying deferent parameters and names, with same result always.

Ive also made otherObject a [SerializeField], so i could confirm that it is indeed a gravestone. (OnTriggerEnter2d is actualy on Fox script, so gravestone is “otherObject”)

(OnTriggerEnter2d is actualy on Fox script, so gravestone is “otherObject”)

That’s what I suspected. You are accessing the Animator component of the gravestone. The gravestone cannot jump, so I assume that you did not define a jumpTrigger in its Animator.

Unfortunately, I cannot copy any code from screenshots, so I hope you know what you need to do to fix the issue in your code. If not, post your code as formatted text here, please.


See also:

[Solved]

Damn…from where did “otherObject.” got infront of GetComponent…

Yup, that was my problem…I was accessing the wrong animator component.

Thanx for helping me out Nina :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms