Make Begin Overlap win the priority over End Overlap

Hello,
I have a situation:

Moto has a “touching ground” indicator as a yellow circle on the wheels.

overlap2

The indicator is important for triggering actions in the game. Not just a design.

The goal of the code is, that when a collision sphere overlaps the ground, it is “not hidden”. When it’s not overlapping. It’s hidden.
(EDIT: The bool set in the picture is my on-going attempt to solve it with bools, but I do not think, it will work).

However, when I cross from one platform to another platform, it seems the code runs as follows:

  1. Enter another platform - begin overlap (indicator is still on from the previous platform)
  2. Leave previous platform: end overlap. (indicator turns off)
    This results in a non-functional indicator when crossing from platform to platform.
    overlap3

Since Begin overlap started before the End overlap, I have to put wheels to the air and “Begin Overlap” again.

So the question is: how to solve this? Can I somehow not trigger End overlap when I am touching the ground? So far it seems to me I have to implement Hit event, but for performance’s sake, I am trying to avoid this.

Any ideas, please? Thank you.

1 Like

I think you need to do it on tick, using ‘get overlapping actors’. That way, you can set the value appropriately by inspecting all the actors involved.

If you’re worried about doing on tick, you already are, that’s how overlap works :wink:

It might be more efficient to make the ground a blueprint, then you can use the class filter on the overlap node, and you don’t need tags as well.

1 Like

Thought this could be a solution, however:
A) The ground is a BP already. It is a parrent BP, which has like 20 children (different sizes, colors of ground). And Get Overlaping Actors filter do not work on the children. So I would have to make like 20 Get Overlapping Actors nodes and add a specific child to each one’s filter.

B) if I do not use filter, it does not detect ground. When I print overlapping actors, it prints only the bike actor. (Wheel sphere collision is in a bike BP Pawn). Like if the detection ends in the scope of the blueprint.

If I use a class filter and test it on a specific ground child, it works. But that returns me to the point A.

Thank you for your time so far and if you have any insight, that would be highly appreciated.

1 Like

It should work with the filter on any ground BP, including the parent, if they are correctly inheriting from each other… :melting_face:

You could also just look for tags. It may be just as efficient.

It is my first no-tutorial UE project, so one big mess. So after like an hour of trying to play with your solution, which would be perfect if I were able to inherit the children in the filter… which for mysterious reasons I was not able to do… (i was changing collision settings in the children frequently from start of project)…

… I discovered another solution, after which I consider myself to be a clever person… :smiley:

On the end of the overlap:

Just turn the overlapping on and off… the most universal solution to this computer stuff…
It works fine for the specific situation.

Your solution taught me new stuff which I do not use now, but thanks anyway. I love how every challenge expands knowledge.

1 Like

Universal reset! :cowboy_hat_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.