// Fill out your copyright notice in the Description page of Project Settings. #include "RailwayCarriage.h" #include "Components/StaticMeshComponent.h" // Sets default values ARailwayCarriage::ARailwayCarriage() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. //PrimaryActorTick.bCanEverTick = false; // root Root = CreateDefaultSubobject(TEXT("Root")); RootComponent = Root; // body mesh railway railwayBody = CreateDefaultSubobject(TEXT("railway")); railwayBody->AttachTo(Root); wheel_0 = CreateDefaultSubobject(TEXT("wheel_0")); wheel_0->AttachTo(railwayBody); wheel_1 = CreateDefaultSubobject(TEXT("wheel_1")); wheel_1->AttachTo(railwayBody); wheel_2 = CreateDefaultSubobject(TEXT("wheel_2")); wheel_2->AttachTo(railwayBody); wheel_3 = CreateDefaultSubobject(TEXT("wheel_3")); wheel_3->AttachTo(railwayBody); } // Called when the game starts or when spawned void ARailwayCarriage::BeginPlay() { Super::BeginPlay(); oldLocation = GetActorLocation(); } /* // Called every frame void ARailwayCarriage::Tick(float DeltaTime) { Super::Tick(DeltaTime); } */