Setting Scale Transforms with SetActorTransform, Only Scale3D is not Replicating

In the pic above I used the same single function to set the rotation, the scaling, and the location using FTransform, but the scaling alone is not replicating (using the single server function). Location and Rotation replicated just fine.


Dear Friends at Epic,

I am using a single function to handle rotation, location, and scaling of in-game objects in my in-game multiplayer editor.

Location and Rotation are replicating flawlessly via the function below

Scaling is not replicating

I dont know why just scaling would not be working using the exact same function which is using an FTransform.

Any ideas?

Thanks!

.h

//Server Transform
UFUNCTION(reliable, server)
void SERVER_TransformSMA(FTransform VictoryTransform, AStaticMeshActor * VSMA = NULL);

.cpp

void AVictoryPower::SERVER_TransformSMA_Implementation(
	FTransform VictoryTransform, 
	AStaticMeshActor* VSMA
){
	
	//Using this setup rotation and movement replicate just fine
	//scaling does not
	
	if (!VSMA) return;
	//~~~~~~~~~~~~~
	
	VSMA->SetActorTransform(VictoryTransform);
	
}	

calling the function using mouse delta to cause uniform scaling

SelectedActorTransform = VictoryPC->SelectedActor->GetTransform();

	if (VictoryPC->IsInputKeyDown(EKeys::A))
	{
	//ALT - Scaling
	if (VictoryPC->PlayerInput->IsAltPressed())
	{
		RV_Vect = UnitVector;
		
		//use mouse x or mouse y
		if (FMath::Abs(VictoryPC->MouseDeltaX) > FMath::Abs(VictoryPC->MouseDeltaY))
			RV_Vect *= 1 + VictoryPC->MouseDeltaX * ShiftedMult;
		else RV_Vect *= 1 + VictoryPC->MouseDeltaY * ShiftedMult;
		
		//Multiply Scale 3D
		SelectedActorTransform.MultiplyScale3D(RV_Vect);
		
		//Server Transform
		SERVER_TransformSMA(
			SelectedActorTransform, 
			VictoryPC->SelectedSMA
		);
		return;
	}	
}

:slight_smile:

Rama

#Update

I did the workaround of actually manually replicating just the scale component of the FTransform

but it’d be lovely if SetActorTransformation would replicate the scaling for me :slight_smile:

//Rep Scaling Only - Temp Fix
SERVER_SetScale(
	FVector_NetQuantize100(SelectedActorTransform.GetScale3D()),
	VictoryPC->SelectedSMA
);

//temp fix

void AJoySMA::OnRep_SetScale3D()
{
	SetActorRelativeScale3D(ClientOnlyScale3D);
}

Your analysis is correct; scaling does not replicate by default in UE4. We may look at adding this but until then, you are best to manually replicate it.

okay, thanks Dave!

My current setup is working very smoothly so it’s all good :slight_smile:

Great to hear from you!

Rama

I’m running into this exact problem. Would be cool if this is someday implemented :slight_smile: