I am new to game development and Unreal Engine 4. I am using version 4.7
I have created a StaticMeshComponent and kept that as a RootComponent. Also I have added StaticMeshObject inside the code instead of adding it in the Details Panel. But its not working when I loaded it in the editor.
class BPCPP2_API AMyActor1 : public AActor
// Sets default values for this actor's properties
virtual void PostInitializeComponents() OVERRIDE;
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
UStaticMesh * Chair1;
// 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;
StaticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticComponent"));
static ConstructorHelpers::FObjectFinder<UStaticMesh> ChairMesh1(TEXT("Content'/Chairs_Chair1.uasset'"));
RootComponent = StaticMeshComponent;
FVector Location(0, 0, 0);
StaticMeshComponent->Mobility = EComponentMobility::Static;
Can somebody please check the code and help me to find the solution for this issue.
Thanks in advance!
Mar 19 '15 at 01:41 PM
in C++ Programming