How do I attach an Actor to a Character?

I’m attempting to pass a ‘Weapon’ class into my character, spawn it and attach it to my character so it moves with it (I understand this can be done with sockets but do not currently want to do that). The weapon actor gets spawned, but its bellow the floor in my level and does not move at all with the character. I have checked that everything has a mobility of EComponentMobility::Movable.

Weapon is spawned like this (taken from the first person projectile spawning example):

	if (CurrentWeapon != NULL)
		{
			const FRotator SpawnRotation = GetControlRotation();
			const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset);

			UWorld* const World = ();
			if (World != NULL)
			{
				SpawnedWep = World->SpawnActor<AWeapon>(CurrentWeapon, SpawnLocation, SpawnRotation);
				SpawnedWep->AttachRootComponentToActor(this, NAME_None, EAttachLocation::KeepRelativeOffset);
			}
		}

This is the Weapons constructor:

	GunOffset = FVector(100.0f, 30.0f, 10.0f);

	WeaponMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("WeaponMesh"));
	WeaponMesh->SetOnlyOwnerSee(false);			
	WeaponMesh->SetVisibility(true, true);
	WeaponMesh->RelativeLocation = GunOffset;
	WeaponMesh->bCastDynamicShadow = true;
	WeaponMesh->CastShadow = true;
	WeaponMesh->Mobility = EComponentMobility::Movable;

EDIT:
I have even tried setting up a tick to manually move the Weapon. This does not work either. Shown below:

	void AProjectAloeCharacter::Tick(float DeltaTime)
	{
		Super::Tick(DeltaTime);
		
		if (SpawnedWep != NULL)
		{
			UE_LOG(LogTemp, Warning, TEXT("Move being called")); // This is being called
			SpawnedWep->SetActorLocation(GetActorLocation());
		}
	}

You need to create socket in your character mesh and attach weapon to that socket (type in name instead of NAME_None)

So actor’s can’t be moved without having a socket? I cant move this one AT ALL. Even if I eject myself and try and move it manually it won’t move.

Does your player controller own this AActor? Is the set actor location and other code occurring on the server (ROLE_Authority)?

You can by using ‘SetOwner’.