Attach weapon using C++

You can remove the dummy root component, i.e. replace your constructor with:

        AMyWeapon::AMyWeapon(const class FPostConstructInitializeProperties& PCIP)
            : Super(PCIP)
        {
            // We must tick
            PrimaryActorTick.bCanEverTick = true;
       
            // Weapon Comp
            Weapon = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Weapon"));
            RootComponent = Weapon;
        }

If you are not getting any errors, the only other things I can think of:

  • Make sure that the mesh isn’t tiny or massive - this could cause you not to see it.
  • Make sure that the weapon class and mesh are not hidden