- Home /
Mirror multiplayer non-player object movement control options
Intent - Player fires a guided rocket. Once fired, player has first person view inside rocket and can control left and right turning.
Info - Game is Server authoritative. Controls are using Unity's new InputSystem.
Current State - After much trial and error, I have succeeded in getting the desired result by sending a rotation float to the rocket with a [Command] that runs in FixedUpdate on the player.
Question/Issue - Sending a [Command] in any Update loop can cause a high amount of traffic on the network, which is a concern for my FPS game already. I am looking for the cleanest way to control a "fast moving" non-player object on a Server Authoritative game. I tried to "directly" control the rocket using the InputSystem like you would for the player, but had no luck whatsoever(the target method would not "fire" at all). I believe it had to do with the rocket not being a player object. I have considered changing the player object over to the rocket and back after it is destroyed, but I think that will be much more of an issue. By the way, when the rocket is spawned, it is given client authority. Any suggestions would be greatly appreciated.
Answer by djirving82 · May 04, 2021 at 04:56 AM
Update: I was able to greatly reduce the number of calls over the network by only calling if the rotation float changed by more than 0.01f. It went from 708 calls in 14 seconds to 172 calls in 14 seconds. There was no noticeable difference in the rockets performance either. I am VERY happy about this!