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;
}
}
Rama