Hello friends,
I coded a simple RPC function to make my character sprint. It works perfectly fine for SinglePlayer but for some reason when I try to play it in multiplayer with 2 players in PIE UE4 crashes. I figured out it must be somehow related to the networking code I wrote. But there are no errors, no logs nothing. Just crash. No minidumps, nothing.
Here’s the code to my RPC functions:
void ABaseHero::SetSprinting(bool bNewValue, float fNewValue)
{
bIsSprinting = bNewValue;
GetCharacterMovement()->MaxWalkSpeed = fNewValue;
if (Role < ROLE_Authority)
{
ServerSetSprinting(bNewValue, fNewValue);
}
}
bool ABaseHero::ServerSetSprinting_Validate(bool bNewValue, float fNewValue)
{
return true;
}
void ABaseHero::ServerSetSprinting_Implementation(bool bNewValue, float fNewValue)
{
SetSprinting(bNewValue, fNewValue);
}
Everything seems fine for me here. If you guys need it I’d post my entire class code.
EDIT: Okay so I tried some debugging and realised that even if I start in singleplayer in stand alone game, pressing shift key (as it’s mapped to my sprinting functionality) causes crash.