UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a car"
// Create a car ACar::ACar() { PrimaryActorTick.bCanEverTick = true; MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh Component")); RootComponent = MeshComponent; WheelFL = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WheelFL")); WheelFL->SetupAttachment(RootComponent); WheelFR = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WheelFR")); WheelFR->SetupAttachment(RootComponent); WheelRL = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WheelRL")); WheelRL->SetupAttachment(RootComponent); WheelRR = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("WheelRR")); WheelRR->SetupAttachment(RootComponent); }