there are booster and respawn functions in my codes.
they work fine without action input mapping with listen server.
but if i make those function occur when pressing keyboard.
character in client goes back to where he was. it’s like teleporting back to where he was.
I belive there’s no problem in logic but in network setting or replication.
because, it looks like server is like “I’m not accepting your transformation go back, i will ignore your last move!”
PlayerInputComponent->BindAction("Respawn", IE_Pressed, this,&AMyCharacter::Respawn);
PlayerInputComponent->BindAction("Use", IE_Pressed, this, &AMyCharacter::UseItem);
void AMyCharacter::Respawn()
{
SetActorLocation(_respawn);
}
void AMyCharacter::UseItem()
{
if (_itemOn || _inventory.Num()==0)
return;
AMyPickups* item = _inventory.Pop();
if (item)
{
_worldManager->UpdateHUD();
item->Activate();
}
}
below’s core logic in boost function
_character->_characterMovementComponent->MaxWalkSpeed *= _effect;