How to change animation speed in Blueprint?

So I have this character who moves around and shoots. I have an animation blueprint set up for him, and I want his shooting animation to change playback speed based on the gun he has. What is the best way to do this?

One way to do it is make a float variable in your animation blueprint, let’s say, “ShootSpeed”. Then in the tick of the animation blueprint you get your player pawn by using the “[Try Get Pawn Owner][1]” node, then cast that to your specific player type, then get the type of gun and based on that set your ShootSpeed variable. Then the final step is select your shooting animation node in the animation blueprint and expose it’s playrate pin and connect the “ShootSpeed” variable to your newly exposed playrate.

I have attached an image of how to expose the play rate of an animation sequence node below: