onoverlapbegin ue4 c 2b 2b

Solutions on MaxInterview for onoverlapbegin ue4 c 2b 2b by the best coders in the world

showing results for - "onoverlapbegin ue4 c 2b 2b"
Lia
30 Jan 2020
1...
2void AUnrealCPPCharacter::OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
3{
4	if (OtherActor && (OtherActor != this) && OtherComp) 
5	{
6		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Overlap Begin"));
7	}
8} 
9
10void AUnrealCPPCharacter::OnOverlapEnd(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
11{
12	if (OtherActor && (OtherActor != this) && OtherComp) 
13	{
14		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Overlap End"));
15	}
16}
17
Tommaso
08 Sep 2020
1public
2  ...
3
4  // declare overlap begin function
5	UFUNCTION()
6	void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
7
8	// declare overlap end function
9	UFUNCTION()
10	void OnOverlapEnd(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
11
Isabell
11 Nov 2018
1void ALightSwitchCodeOnly::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)  
2{  
3    // Other Actor is the actor that triggered the event. Check that is not ourself.  
4    if ( (OtherActor != nullptr ) && (OtherActor != this) && ( OtherComp != nullptr ) )  
5    {  
6        // Turn off the light  
7        PointLight->SetVisibility(false);  
8    }  
9}
Loan
07 Jan 2021
1AUnrealCPPCharacter::AUnrealCPPCharacter()
2{
3  ...
4
5  // declare overlap events
6	TriggerCapsule->OnComponentBeginOverlap.AddDynamic(this, &AUnrealCPPCharacter::OnOverlapBegin); 
7	TriggerCapsule->OnComponentEndOverlap.AddDynamic(this, &AUnrealCPPCharacter::OnOverlapEnd); 
8
9}
10