Altering Character Movement Speed with a structure table

Hey, so I’m making a tower defence game, and I want the enemy movement speed to increase over time. They use the CharacterMovement component and use that max walking speed for speed. How do I change this using the data table? I cant find a way to actually edit this using a float variable. Other than just changing it manually, which obviously doesn’t have the effect I need.

Also sorry for it being badly written, not the best at explaining things :smiley:

Thanks for the help guys!

To elaborate in case it matters. I want to create a tower defence game, where the longer the player survives the harder it gets, IE the enemy move faster and have more health. Instead of a wave based game its just based on how long they survive, like increasing speed by slowly adding 1 to movement speed for example, how would I go about that?

Add a couple of float parameters to your Data Table, one for defining how often (in seconds) the difficulty increases, and another for determining by how much it affects the movement speed of the AI.

At level start, start a timer with an interval equal to the first parameter mentioned above. The timer will automatically run a specified event at regular intervals. You can use this event to get all AI bots present in the level (keep an array that you update whenever a bot gets spawned/destroyed instead of using the expensive Get All Actors of Class node), and increment their Max Walking Speed (using the speed modifier variable mentioned in next para) based on the second parameter. This will take care of updates to all units that are already present in the level.

As for spawning new bots with increased speeds, add a new variable to your AI class to specify the speed modifier. Set it to editable and expose on spawn as shown below. Now you can pass the modifier value through Spawn Actor node and then add this value to the default Max Walking Speed through the construction script as shown below: