Language:
Discover
By Skill Level
By Category

OnComponentEndOverlap

Choose your OS:

Syntax

FComponentEndOverlapSignature OnComponentEndOverlap

Remarks

Event called when something stops overlapping this component

Both this component and the other one must have GetGenerateOverlapEvents() set to true to generate overlap events.

Example Code

LightSwitchCodeOnly.cpp at line 31:

    // set up a notification for when this component overlaps something  
    CollisionSphere->OnComponentEndOverlap.AddDynamic(this, &ALightSwitchCodeOnly::OnOverlapEnd);  

LightSwitchCodeOnly.cpp at line 52:

void ALightSwitchCodeOnly::OnOverlapEnd(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)  
{  
    // Other Actor is the actor that triggered the event. Check that is not ourself.  
    if ( (OtherActor != nullptr ) && (OtherActor != this) && ( OtherComp != nullptr ) )  
    {  
        // Turn on the light  
        PointLight->SetVisibility(true);  
    }  
}