You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If during an update cycle the rotation of an GameObject with a NetworkTransform (unreliable) component changes enough to be over the rotationSensitivity value, the rotationChanged flag gets set
Afterwards the current snapshot (inlcuding the current position AND rotation values) are stored as the lastSnapshot and used for the next comparison, if the GameObject hast moved or was rotated.
[IMPORTANT] How can we reproduce the issue, step by step:
create a scene for client-server with Mirror
add a GameObject with the NetworkTransformUnreliable component
add a script that rotates the GameObject serverside continously with 0.1 degree and moves it 0.01 units in one direction per update cycle
set that rotation and position sensitivity to 0.05
start the server and the client
connect the client to the server
the GameObject's rotation and position should change on the server, but on the client only the rotation changes, not the position
Expected behavior
NetworkTransform updates position and rotation at least occationally, even when only one component is above its sensitivity value. In the given example, the rotation updates in every cycle, but the position updates in every 5th cycle when the accumulated position change exceeds the position sensitivity.
Desktop (please complete the following information):
OS: Windows
Build target: standalone
Unity version: 2020.3
Mirror branch: release 79.0.1
Additional context
Small example with one dimentional position and rotation.
changerate position: +0.8
changerate rotation: +1.5
position/rotaion sensitivities: 1.0
Time t = 0:
game object
pos = 0
rot = 0
snapshot
pos = 0
rot = 0
Time t = 1:
game object
pos = 0.8
rot = 1.5
checks
pos: 0.8 - 0.0 = 0.8 < 1.0 > not send
rot: 1.5 - 0.0 = 1.5 > 1.0 > send
new snapshot
pos = 0.8
rot = 1.5
Time t = 2:
game object
pos = 1.6
rot = 3.0
checks
pos: 1.6 - 0.8 = 0.8 < 1.0 > not send
rot: 3.0 - 1.5 = 1.5 > 1.0 > send
new snapshot
pos = 1.6
rot = 3.0
The text was updated successfully, but these errors were encountered:
Describe the bug
If during an update cycle the rotation of an GameObject with a NetworkTransform (unreliable) component changes enough to be over the
rotationSensitivity
value, therotationChanged
flag gets setMirror/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs
Line 303 in e92e91d
At the same time the position of the GameObject changes less than the
positionSensitivity
value andpositionChanged
does not get setMirror/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs
Line 302 in e92e91d
In
UpdateServerBroadcast
then only the rotation value gets broadcastedMirror/Assets/Mirror/Components/NetworkTransform/NetworkTransformUnreliable.cs
Lines 129 to 131 in e92e91d
Afterwards the current snapshot (inlcuding the current position AND rotation values) are stored as the
lastSnapshot
and used for the next comparison, if the GameObject hast moved or was rotated.[IMPORTANT] How can we reproduce the issue, step by step:
Expected behavior
NetworkTransform updates position and rotation at least occationally, even when only one component is above its sensitivity value. In the given example, the rotation updates in every cycle, but the position updates in every 5th cycle when the accumulated position change exceeds the position sensitivity.
Desktop (please complete the following information):
Additional context
Small example with one dimentional position and rotation.
changerate position: +0.8
changerate rotation: +1.5
position/rotaion sensitivities: 1.0
The text was updated successfully, but these errors were encountered: