Weapon Incorrectly Rotated Mesh1P from a duplicated ShooterGame project

Blast from the past but I figured out the issue so I thought I would share it. The issue here is that you have Mesh1P as the rootcomponent, which doesn’t allow the location or rotation to be edited, per code in FSceneComponentDetails::MakeTransformDetails(). Also you can’t add a blank object then make it the rootcomponent because Mesh1P is inherited from code. So you have to adjust the code itself to make a blank component the root component then attach the Mesh1P to it. If you’re not sure how to do so here is the code:

In ShooterWeapon.h

UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
USceneComponent* SceneComponent;

In ShooterWeapon.cpp

AShooterWeapon::AShooterWeapon(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
	SceneComponent = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("Root"));
	RootComponent = SceneComponent;
	
	Mesh1P = ObjectInitializer.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("WeaponMesh1P"));
	Mesh1P->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered;
	Mesh1P->bReceivesDecals = false;
	Mesh1P->CastShadow = false;
	Mesh1P->SetCollisionObjectType(ECC_WorldDynamic);
	Mesh1P->SetCollisionEnabled(ECollisionEnabled::NoCollision);
	Mesh1P->SetCollisionResponseToAllChannels(ECR_Ignore);
	Mesh1P->SetupAttachment(SceneComponent);

You need the SetupAttachment line as well as the construction of the new SceneComponent. But yeah, do this and ouila, the transform is now editable for Mesh1P.