A record of handy visual assist snippets for Unreal Engine 4.
void A$FILE_BASE$::BeginPlay() {
$end$
}
$PlayerInputComponent$->Bind$Axis$("$Turn$", $Event=IE_Pressed,$ this, &A$FILE_BASE$::$MyFunc$);$end$
check($Pointer$ != nullptr);$end$
A$FILE_BASE$::A$FILE_BASE$() {
$end$
}
CreateDefaultSubobject<$USceneComponent$>(TEXT("$Root$"));
$end$
UE_LOG($LogTemp$, $Warning$, TEXT("$Message$"))$end$
void A$FILE_BASE$::HandleOverlap(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult & SweepResult
) {
//Don't forget to bind
//OverlapComp->OnComponentBeginOverlap.AddDynamic(this, &MyClassName::HandleOverlap);
$end$
}
if (GEngine) {
GEngine->AddOnScreenDebugMessage(
-1,
15.0f,
FColor::Yellow,
FString::Printf(TEXT("$say$: %$f$"), $Output$)
);
}
$end$
void A$FILE_BASE$::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
$end$
}