Download

Make animation blueprint variable public? - Casting to an Animation BP FROM an Actor BP

Hi, I’ve been going crazy trying to figure this out, I’m sure its really simple! I have a swinging axe animation, so I have that skeletal mesh inside an actor blueprint called AxeTrap_BP, thats in the level playing fine. The animation swing has been set up in the AxeTrap_AnimBP, this has been done using a statemachine with one animation applied (Is this even the correct way for something so simple?).

Basically all I want to do is make a variable inside the AnimBP (in this case im testing Play Rate) exposed on my AxeTrap_BP that I have in my level, so I can change the Play Rates on the fly. You can see from my images what I’ve been trying to do, in my head that makes sense? But I can’t get the cast to animBP to work in any situation! Any help here would be really appreciated! Thanks

*Just seen in the second image I need a public variable to feed into the Play Rate Test, just something I’ve accidently deleted in my numerous attempts.

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_215357_1614896298924_657”}[/ATTACH]

In Event Update Animation get your character reference -> variable and set your “PlayRateTest” variable.

You can’t use a timeline? Then you won’t need to talk between blueprints. And you can still affect timeline play rate.

Thanks for the reply, do you mean like below? I deleted the construction script and added that, while it didn’t error it doesn’t seem to work. I was under the impression anything after Event Blueprint Update Animation ran at play time? I just want to be able to edit variables in the level before playing. Thanks

Hmmmm, I mean I probably can? Haha, sorry still new to UE4 so lot’s of things just fall off the the radar. Will check out how to do that tomorrow! Thanks

Event Blueprint Update Animation ran in tick. If you change “Set Play Rate” variable in your AxeTrap_BP, you should set that variable in AnimBP as well.
If this does not work, try to debug: print out variables from BP and AnimBP and compare it.

Thanks for the suggestions guys, looking at the timeline allowed me to find I could literally just PLAY ANIMATION. So for anyone else as clueless as me I just used Override Animation Data node in the construction script and I can easily just edit the variables I wanted. Thanks