#Help with Networked FPS Player Input & Audio Synchronization

1 messages · Page 1 of 1 (latest)

idle pumice
#

Hi everyone,
I’m developing a first-person multiplayer game in Unity using Mirror. The main gameplay involves a single player per client moving around, jumping, crouching, sprinting, and interacting with the environment. Each player has a first-person camera and full body animations.

My current set-up is:

  • Player prefab hierarchy:
    Player (NetworkIdentity, NetworkTransform, Player script, PlayerInput, FPController, NetworkAnimator)
    ├─ FirstPersonCamera (Cinemachine Camera)
    ├─ FP Modules (FP Jump, FP Sounds, AudioSource, FP Sprint, FP Crouch, FP Camera Land, FP Head Bob)
    └─ Mesh_protective_suit (Animator, FP Camera Controller, Bone Renderer, Full Body Animator)
  • Using Unity Input System for player controls.
  • I have a FPSounds script for footsteps, jump, and landing sounds.

What i want to implement is:

  • Each player should control their own character using their local keyboard and mouse.
  • All audio events (footsteps, jumps, landings) should play both locally and on other clients (Obviously).

The problems i'm facing right now are:

  • Error: Cannot find matching control scheme for Player(Clone) (all control schemes are already paired to matching devices)
  • Audio plays locally but not across the network.

I would really appreciate any guidance, examples, or tips on how to solve these issues, especially since this is my first time working with Mirror and multiplayer networking. Any advice or best practices would be extremely helpful. Thank you in advance for your time and help!

tropic geode
#

I don't use Mirror. But you'll need to disable the camera and inputs from all the remote player prefabs when they spawn in.
If you audio is controlled by scripts then you'll need to send RPCs to play those clips

hollow talon
#

well sending audio via RPCs is some kind of waste bandwidth but that the easy method, you could add event animation of footstep audio. Also Each player should control their own character using their local keyboard and mouse. that is i believe the most basic one just by casting IsOwner. not sure what it called in mirror.

tropic geode
#

Yea, RPCs would be triggering the audio clips not sending the audio itself

idle pumice
#

Tyvm, i'll try to implement ur advices and i'll let u know 🙂

idle pumice
#

it worked :D. (i think, since i hear double sound)

now i have to create the main menu and lobby system T_T
do u happen to have some advices on that?

tropic geode
#

You can use Unity Game Services for Lobby and Relay with Mirror. Steam also has lobbies. It would be better to make a separate thread for this though

idle pumice
#

okk tyvm