Currently having a client be the server(listen server) hosting the game and allowing other clients to join but as of now the clients that join the server can’t move at all. Everything is set to replicate(movement, etc.) including the functions regarding the movement.
PlayerPawn.h
UFUNCTION(Server, Reliable)
void MoveForward(float _value);
void MoveForward_Implementation(float _value);
UFUNCTION(Server, Reliable)
void MoveRight(float _value);
void MoveRight_Implementation(float _value);
UFUNCTION(Server, Reliable)
void MoveUp(float _value);
void MoveUp_Implementation(float _value);
UFUNCTION(Server, Reliable)
void LookUp(float _value);
void LookUp_Implementation(float _value);
UFUNCTION(Server, Reliable)
void Turn(float _value);
void Turn_Implementation(float _value);
PlayerPawn.cpp
void APlayerPawn::MoveForward_Implementation(float _value)
{
if ((Controller) && (_value != 0.0f))
{
FVector directionLocal = FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::X);
directionLocal = FVector(directionLocal.X, directionLocal.Y, 0.0f).GetSafeNormal();
AddMovementInput(directionLocal, _value);
}
}
void APlayerPawn::MoveRight_Implementation(float _value)
{
if ((Controller) && (_value != 0.0f))
{
FVector directionLocal = FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::Y);
AddMovementInput(directionLocal, _value);
}
}
void APlayerPawn::MoveUp_Implementation(float _value)
{
if ((Controller) && (_value != 0.0f))
{
FVector directionLocal = FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::Z);
AddMovementInput(directionLocal.ZAxisVector, _value);
}
}
void APlayerPawn::LookUp_Implementation(float _value)
{
AddControllerPitchInput(_value * BaseLookUpRate * GetWorld()->GetDeltaSeconds());
}
void APlayerPawn::Turn_Implementation(float _value)
{
AddControllerYawInput(_value * BaseTurnRate * GetWorld()->GetDeltaSeconds());
}
Any ideas?
Thanks in advance.