Can you make it so when your player overlaps a collision box the player walk speed is decreased until collision ends?

Greetings everyone,

So currently I’m just building a simple open world level where there are certain areas I want the player to walk slower, or, in other terms, decrease the walk speed to 300. I am able to do this on my own but I also added in a sprint system which conflicts with decreasing the walk speed on overlap. This happens because once you hit the collision box (where it decreases the walk speed) you can just sprint and it resets the speed back to normal. Is there any way to check to see if the player is still in the collision box and not be able to increase the walk speed, or to disable the sprint?
(I’m new to UE4 so sorry if this is a basic question)

Many thanks in advance!

Make a boolean in your character. Set it to true when you start overlapping with the collision box(OnBeginOverlap event) and false when the overlapping ends(OnEndOverlap event). When you press the sprint button, check the boolean first, if it is true, you can’t sprint, if it is false, you can sprint.