UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a custom pawn"
#include "MyPawn.h" #include "Components/StaticMeshComponent.h" // Sets default values AMyPawn::AMyPawn() { // Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; // Create the mesh component MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComponent")); RootComponent = MeshComponent; } // Called when the game starts or when spawned void AMyPawn::BeginPlay() { Super::BeginPlay(); } // Called every frame void AMyPawn::Tick(float DeltaTime) { Super::Tick(DeltaTime); } // Called to bind functionality to input void AMyPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); }