How to get the object the character has stepped on

Hello, I am making a running game using c++.
I try to make it disappear when I step on a certain floor.
But I don’t know how to find out what the object stepped on.
Currently, I am using the Landed(const FHitResult& Hit) function on the character, but this function doesn’t seem to get the object.
However, to use overlap, I can’t use it because I’m afraid it will disappear just by touching it.
Is there a way to get a stepped object?

Define “step” here? Is the character walking, jumping, or something else?

“Landed” event, I believe, is triggered when you hit a floor surface while falling.

I don’t believe there’s a built in “stepped on” concept, but you could certainly simulate it in many different ways… depending on what you actually want to achieve… so define “step” :smiley:

I’m sorry I used a translator to give you something confusing to understand.
What I was trying to do was to receive a LAND object when the LAND function is invoked.
As a result of thinking a little, the ONOVERLAPBEGIN event was handled only when stepping on the collision box by placing the collision box only on the object.

if Landed is being called, since you’re falling onto the item, then the HitResult will contain an Actor that is hit.

There’s a protected BasedMovement member in ACharacter (and public read-only getters). The struct contains a UPrimitiveComponent* MovementBase. It may be null but should be updated while the movment mode is walking.

Oh… i’ll have to try! Thank you!

Thank you! i’ll have to try too!

If you’re using a UCharacterMovementComponent you could also query the CurrentFloor to find information about the floor your character is currently standing on. this returns FFindFloorResult which contains an FHitResult from which you can use GetActor() to find the floor actor that you’re standing on.