Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PredictedRigidbody RecordState can early out even when not intended #3926

Open
Tshadow05 opened this issue Oct 17, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Tshadow05
Copy link

Tshadow05 commented Oct 17, 2024

PredictedRigbody -> RecordState function has an early out to not run except at a set interval. But OnRecievedState, which comes from the server, fires RecordState expecting it to always save the state so we can compare with the most up to date information. So I think there needs to be a function or parameter that lets the recording function always fire. This probably only causes minor out of sync issues unless you set the recordInterval high.

Mirror Version: 89.15.6

@MrGadget1024 MrGadget1024 added the bug Something isn't working label Oct 17, 2024
@Tshadow05
Copy link
Author

I personally moved the time check in the FixedUpdate loop itself before it calls RecordState.
`

    void FixedUpdate() {
        ...

        // instead of recording every fixedupdate, let's record in an interval.
        // we don't want to record every tiny move and correct too hard.
        if (NetworkTime.time < lastRecordTime + recordInterval) return;

        RecordState();
    }

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants