I am trying to create an air vent that when stood over will apply a force to the character up to a limit where they will hover in place. I created an actor that is comprised of approximately 10 hit boxes evenly spaced apart. Theoretically, when the character touches the bottom hit box, a force should be applied to them that shoots them up through the next hit box, ad nausea, until the limit is reached at the top and the character hovers in place. I am almost certain there is a much simpler way of implementing this, such as a hitbox that detects a character inside it and incrementally applies an upwards force until they are on top of the hitbox. Unfortunately, there only seems to be an event begin overlap and an event end overlap detector, I can’t find anything that constantly checks if the character is within the bounds of the box, so I tried implementing it in the way that you can see in the attached picture. But it seems that even this doesn’t work, as all of the individual components seem to share the one collision detector. When I walk into this array of boxes, it only triggers the force once and then stops, leaving me with one measly hop and no cool hover mechanic. I even tried using while loops that are controlled by booleans that are updated by the overlap events, but that just led to unreal engine crashing. Any ideas on how to implement this properly are much appreciated.
I can’t find anything that constantly checks if the character is within the bounds of the box
There is event Tick, which fires constantly (every frame).
And primitive components provide function GetOverlappingActors, which can take a class as filter.
Use event Tick to apply a constant force to all characters overlapping the box :
Tick -> GetOverlappingActors(class Character) -> Foreach -> Add Force