Hello, I am fairly new to Unreal 4 and game development in general so please forgive me if my question is too vague or difficult to answer. The issue I am having is that when a client or the server looks up or down, the mesh on the any other clients doesn’t update. Also the direction the character is facing is not updating cleanly. Since I am just getting used to using unreal 4, I am using sample assets from the content examples and the shooter game for the meshes and animations. Here is a link to a video of the issue: ForthUnrealVideo - YouTube (Sorry for the bad quality).
Here’s is the relevant source code:
//Character Class Constructor
AMyCharacter::AMyCharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
FirstPersonCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));
FirstPersonCameraComponent->AttachParent = CapsuleComponent;
FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 50.0f + BaseEyeHeight);
FirstPersonMesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("FirstPersonMesh"));
FirstPersonMesh->SetOnlyOwnerSee(true);
FirstPersonMesh->AttachParent = FirstPersonCameraComponent;
FirstPersonMesh->bCastDynamicShadow = false;
FirstPersonMesh->CastShadow = false;
FirstPersonMesh->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
Mesh->SetOwnerNoSee(true);
Mesh->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
AMyCharacter::Health = 100;
bReplicates = true;
}
//And the input component setup:
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* InputComponent)
{
InputComponent->BindAxis("MoveForward", this, &AMyCharacter::MoveForward);
InputComponent->BindAxis("MoveRight", this, &AMyCharacter::MoveRight);
InputComponent->BindAction("Jump", IE_Pressed, this, &AMyCharacter::OnStartJump);
InputComponent->BindAction("Jump", IE_Released, this, &AMyCharacter::OnStopJump);
InputComponent->BindAxis("LookRight", this, &AMyCharacter::AddControllerYawInput);
InputComponent->BindAxis("LookUp", this, &AMyCharacter::AddControllerPitchInput);
InputComponent->BindAction("Fire", IE_Pressed, this, &AMyCharacter::OnFire);
}
Thank you in advance ; )