March 2019
Intermediate to advanced
708 pages
17h 9m
English
// Sets default valuesAMyFirstActor::AMyFirstActor(){ // Set this actor to call Tick() every frame. You can turn this off // to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; // Creates a StaticMeshComponent on this object and assigns Mesh // to it Mesh = CreateDefaultSubobject<UStaticMeshComponent> ("BaseMeshComponent"); auto MeshAsset = ConstructorHelpers::FObjectFinder<UStaticMesh> (TEXT("StaticMesh'/Engine/BasicShapes/Cube.Cube'")); // Check if the MeshAsset is valid before setting it if (MeshAsset.Object != nullptr) { Mesh->SetStaticMesh(MeshAsset.Object); }}
Read now
Unlock full access