Im using a UChildActorComponent to house my weapon class in my FPS Game. But the weapon is never created?
Header Definition of component in player header:
UPROPERTY(VisibleDefaultsOnly, Category = Weapon)
class UChildActorComponent* Weapon;
Weapon Class Definition in player header:
UPROPERTY(EditDefaultsOnly, Category = Weapon)
TSubclassOf<class AWeapon> WeaponClass;
Player constructor:
Weapon = CreateDefaultSubobject<UChildActorComponent>(TEXT("Weapon"));
Weapon->SetupAttachment(Mesh1P);
Weapon->SetChildActorClass(WeaponClass->StaticClass());
Weapon->CreateChildActor();
I have a debug message set up in the constructor of my weapon class. it is shown if i drag the weapon directly to into the scene but not when i try to create it as a child actor.