I’m Testing of spawn pawn while in multiplayer gameplay.
I’ve using serverRPC to spawn pawn and spawning pawn is showed up in server and client.
but pawn having weird behavior. when spawnning pawn while jumping, pawn is floating in server but in client, pawn is not floating and moving like possed.
oppsite is same result.
Video for explain
Coding
in Header (MyPlayerController.h)
public:
UFUNCTION(Server, Reliable)
void CreateAndPosses();
in CPP
void AMyPlayerController::CreateAndPosses_Implementation()
{
FVector CurrentLocation = GetPawn()->GetActorLocation();
CurrentLocation.Z += 100.f;
APuzzlePlatformsCharacter* OldCharacter = GetPawn<APuzzlePlatformsCharacter>();
FActorSpawnParameters SpawnParms;
FTransform transform = OldCharacter->GetTransform();
transform.SetLocation(CurrentLocation);
APuzzlePlatformsCharacter* character = GetWorld()->SpawnActor<APuzzlePlatformsCharacter>(PlayerTest, transform, SpawnParms);
/*if (IsValid(OldCharacter)) OldCharacter->Destroy();*/
this->Possess(character);
}
I’ve tested possesing oldcharacter to using tempcontroller but, It’s not worked.
I think it’s related with character movement component however, i don’t really know about that component. So i hope someone explain why this is working like that.
Thank you