TopDownARPG/Triggers/TimeSlowSphere.cpp
// Called when the game starts or when spawned
Called when the game starts or when spawned
Called when the game starts or when spawned
void ATimeSlowSphere::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
	if (OtherActor && (OtherActor != this) && OtherComp)
	{
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Overlap Begin"));
		SlowedActors.Add(OtherActor);
		SlowedActorsInitialSpeed.Add(OtherActor->CustomTimeDilation);
		OtherActor->CustomTimeDilation -= SpeedFactor;
	}
}
void ATimeSlowSphere :: OnOverlapBegin ( UPrimitiveComponent * OverlappedComp , AActor * OtherActor , UPrimitiveComponent * OtherComp , int32 OtherBodyIndex , bool bFromSweep , const FHitResult & SweepResult ) { if ( OtherActor && ( OtherActor != this ) && OtherComp ) { GEngine -> AddOnScreenDebugMessage ( -1 , 5.f , FColor :: Red , TEXT ( " " ) ) ; SlowedActors . Add ( OtherActor ) ; SlowedActorsInitialSpeed . Add ( OtherActor -> CustomTimeDilation ) ; OtherActor -> CustomTimeDilation -= SpeedFactor ; } }
Called when the game starts or when spawned
Called when the game starts or when spawned