Cannot change movement speed of actor

I want to change the movement speed of my actor in a widget blueprint, therefore I used the “get actor of class” node to cast between blueprints.
But apparently it doesn’t work. At least not in the actor blueprint, in the widget the value is properly displayed and changed, but it won’t influence the variable in my actor blueprint.



tor blueprint.

When you use the widget, is there a zombie in existence? That’s what ‘get actor’ does. I assume you’re getting the ‘none’ error when you stop play?

If you want to change the default walk speed of all zombies, you’ll need to use the game instance or the save game to pass the info to them.

I don’t get an non error, but yes the goal is to change the default movement speed of all zombies that spawn from this point in time on.
And your solution sounds plausibel, but I don’t get it to work. If I just cast to “SaveGame” or “GameInstance” I can’t reference the variables in BP_Zombie. Do I have to set it up in a save game or an intance and if how?

It’s quite involved. You can set a variable in the save game or game instance, and then you have to code the zombie to read that variable on initialization.

1 Like