After upgrade to ue5 socket transformation stopped updating on server

Hi,

I have a weird bug after migrating to ue5. To be short in my project I have a component responsible to handle weapons. Based on socket location and rotation from parent pawn skeletal mesh it spawns projectile. Component listens to a server fire event initialized from a parent, when get’s socket transformation, run additional calculations like recoil, etc and spawns projectile on server and effects via RPC. All worked just fine, but after the update, the socket transformation on the server stops updating. This only happens when using a dedicated server. Funny moment if I use multicast function just to test, clients spawn projectile with correct target socket transformation, but server spawns with not updated socket and as result 2 hit server events with different hit locations :blush:.

Also, all bone transformations and animations work just fine on server and clients with dedicated server too.

Wondering if any ideas or tips?

Appreciate any help. Cheers

Ok. problem solved.

  1. Added replicated property to store FTransform for socket location and rotation
  2. Declare RPC Server function to spawn a projectile
  3. Call RPC Client function first to do all calls and when call server function to spawn projectile

it works, but I don’t think it is an ideal solution

here is the code

void UWeaponBaseComponent::SpawnProjectile()
{
#ifdef WITH_EDITOR
	if (bIsTraceDebug)
	{
		BRLog->Log(ELogLevel::TRACE, __FUNCTION__);
	}
#endif

	if (CurrentWeapon.ProjectileClass)
	{
		const FTransform SocketTransform = OwnerMeshRef->GetSocketTransform(
			CurrentWeapon.ProjectileSpawnSocket, ERelativeTransformSpace::RTS_World);
		const FRotator OwnerRotation = SocketTransform.GetRotation().Rotator();

		FRotator FinalProjectileRotation;

		if (CurrentWeapon.bUseWeaponRecoil)
		{
			FinalProjectileRotation = ProjectileSpread(OwnerRotation.Vector()).Rotation();
		}
		else
		{
			FinalProjectileRotation = OwnerRotation;
		}

		ProjectileSpawnTransform.SetLocation(SocketTransform.GetLocation());
		ProjectileSpawnTransform.SetRotation(FQuat(FinalProjectileRotation));

		SR_SpawnProjectile(ProjectileSpawnTransform);

		OnBulletReleasedEvent.Broadcast(this);
	}
}