How do I play my animation in the animation tree?

Instead of the tween or anything you set the oneshot to “fire”

animation_tree["parameters/Score_Change/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE

I tried it, but now I get this error:

Invalid set index 'parameters/Score_Change/request' (on base: 'AnimationTree') with value of type 'int'

What do I do to fix this?

I do not know what the actual parameter name would be for your tree, you will have to copy it from the inspector.

What do you mean from the inspector though?

How did you get the original parameter path?

2024-08-05-215809_3840x1080_scrot

You mean this:

["parameters/Score_Change/add_amount"]

The same way you got the new parameter path

Cool, so you need to change that into the new parameter path, I do not have the same paths my code is only an example to be filled in with real values.

I got this now:

["parameters/Score_Change/request"]

But still the same int error.

That’s crazy! Didn’t expect for my example path to be right, especially with that error. It is supposed to take an int, the error states it’s an AnimationTree, really seems like the path must be wrong. Could you post a screenshot of the AnimationTree inspector like I did to show “Copy Property Path”?

You mean this?
Screenshot 2024-08-06 at 8.03.09 AM

Yes, your path must be "parameters/OneShot/request" not my example path.

1 Like

It works! But that same error from before is still present, I might have to check the animation to see if there’s a problem there instead.

Also Is it still possible for me to access the Play Mode in the animation tree?

I checked the animation, but no problems were really there. Any suggestions?

1 Like

Sounds good! Do you have any issues with the animation tree? You might still have your original warning message about the rotation track, we did not talk much about that aside from my first post.

Yup, I still have that error message. And apparently (this might not be a problem), The animation player is now a dummy player.

I think you need to set the animation player tracks to match interpolation mode, probably setting the RESET animation to linear or cubic angle, what ever matches your ScoreChanged animation.

I am not sure what you mean by a dummy player, if it’s no longer playing animations it may be the Animation Tree is still “Active” thus overriding it’s ability to animate, but we do not need to de-activate it to test.

Here’s what it actually means:

Btw this only happens when I view it from the Animation tab when the AnimationTree is selected. If it’s the animation player this doesn’t appear (which probably makes a lot of sense).

I’ll try that and see if it works.

The error message doesn’t appear anymore, But the problem still persists. Any other suggestions?

Which error message and which problem? I am not sure either is a problem if the game looks as you’d like it to, the original warning in your first post is to make you aware of how and why an animation may behave strange.

Yes, I know. But I can’t just close the topic if there’s another specific issue that also needs to be tackled.

The one about the reset interpolation types (which has now been fixed but hasn’t really made a difference)

The one in this video: