How to make "OnComponentHitEnded"

Hello,
I have a vehicle game. When a wheel is touching the ground, I want to set “TochingGround” Bool set True. But when the wheel is in the air, I want to set it to false. Yet there is no such a function.

Any Idea?
Thank you.

I think you could do a small raycast from the center of mass to the ground, and if its hitting something is the ground, if is not hitting anything, is on air. or you could add some overlap to the wheels and if there touching the specific actor for the ground there on the ground, if not, not. lemme know if worked.

1 Like

Thank you,
adding an extra component for overlapping collision is what did the trick.

btw:
It’s funny how the programming brain is being trained → I was like, if it’s touching, it’s hitting, not overlapping. I cannot use overlap for this… But making another and a bit bigger overlap is a solution, that made me realize, that I’m far from a Senior UE developer job :smiley:

Anyway, simple and functional. Thanks again.

i think overlap is more efficient as you only need to check when it ends or begins, if you were using hit you gotta verify constantly

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