Trying to set class of UChildActorComponent

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"));

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.

TSubclassOf is template type for UClass class which only limits class selection in UE4 editor on field, but it works like UClass* type. So if you call StaticClass() from WeaponClass you will get equivalent of UClass::StaticClass(); which is not even a actor. Just WeaponClass , TSubclassOF is UClass* so it will work.

Weapon = CreateDefaultSubobject<UChildActorComponent>(TEXT("Weapon"));

Also if you ever try to get class from instatiated object use GetClass() function insted of StaticClass() which is dedicated only for static calls like: AActor:StaticClass()

Thank You! Everthing is working now =)