Moto has a “touching ground” indicator as a yellow circle on the wheels.
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:
Enter another platform - begin overlap (indicator is still on from the previous platform)
Leave previous platform: end overlap. (indicator turns off)
This results in a non-functional indicator when crossing from platform to platform.
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.
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
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.
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…