FirstGearGames / FishNet

FishNet: Unity Networking Evolved.
Other
1.39k stars 150 forks source link

Graphical Object being smoothed for owner when 'Smoothed Properties' set to 'Unset' #681

Closed Fuzzmunch closed 5 months ago

Fuzzmunch commented 6 months ago

General Unity version: 2022.3.10f1 Fish-Networking version: 4.3.3R Discord link:

Description Graphical Object being smoothed for owner when 'Smoothed Properties' set to 'Unset'

Replication Set 'Smoothed Properties' to 'Unset' under owner on the NetworkObject component and set the TimeManager tick rate to something low so the smoothing can be seen.

Expected behavior When Smoothed Properties are Unset and TimeManager Tick Rate is low, I expect the graphical objects position to only update with the low tick rate as if the Graphical Object was set to 'None', but it is clearly smoothed to the higher framerate of my project.

FirstGearGames commented 6 months ago

Resolved in 4.3.4. Resolution is to find class ChildTransformTickSmoother and method BasicMoveToTarget.

Replace with this.

        private void BasicMoveToTarget(float delta)
        {
            int tpCount = _transformProperties.Count;
            //No data.
            if (tpCount == 0)
                return;

            TickTransformProperties ttp = _transformProperties.Peek();
            TransformPropertiesFlag smoothedProperties = (_ownerOnPretick) ? _ownerSmoothedProperties : _spectatorSmoothedProperties;
            _moveRates.MoveWorldToTarget(_graphicalObject, ttp.Properties, smoothedProperties, delta);

            //if TimeLeft is <= 0f then transform should be at goal.
            if (_moveRates.TimeRemaining <= 0f)
                ClearTransformPropertiesQueue();
        }