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

Prediction V2 Jitter 4.5.6R #835

Closed
liugoudanzi opened this issue Dec 24, 2024 · 8 comments
Closed

Prediction V2 Jitter 4.5.6R #835

liugoudanzi opened this issue Dec 24, 2024 · 8 comments

Comments

@liugoudanzi
Copy link

liugoudanzi commented Dec 24, 2024

After the introduction of prediction in my project, there was a problem of role jitter after packaging. I researched for several days and could not solve this problem.
I sent a recording screen, can you see what is going on here, and I can send the project to you if necessary.

2024-12-24.23-28-08_20241224233139.mp4
@liugoudanzi
Copy link
Author

ThirdPersonController.zip

This is the script of the movement in the video

@liugoudanzi
Copy link
Author

It's more obvious on my phone than on the screen

Mobile.phone.video_20241226144049_20241226144124.mp4

@NPatel10
Copy link

NPatel10 commented Jan 8, 2025

This happens due to camera is being updated before the physics tick. If you are using cinemachine then set it to manual update mode in CinemachineBrain then use its Update method in PostTick callback of predicted body.

@liugoudanzi
Copy link
Author

发生这种情况是因为摄像机在物理 tick 之前更新。如果你正在使用 cinemachine,则将其设置为手动更新模式,然后在预测身体的回调中使用其方法。CinemachineBrain``Update``PostTick

Can you give a specific tutorial very much thanks

@liugoudanzi
Copy link
Author

发生这种情况是因为摄像机在物理 tick 之前更新。如果你正在使用 cinemachine,则将其设置为手动更新模式,然后在预测身体的回调中使用其方法。CinemachineBrain``Update``PostTick

I changed the mode to manual mode and the camera stopped following my character

@NPatel10
Copy link

You can create a script which updates cinemachine like
public void UpdateCineMachine() { cinemachineBrain.ManualUpdate(); }

Then you can use TimeManager.OnPostTick action provided by Fishnet in PlayerController's OnStartNetwork callback like
public override void OnStartNetwork() { TimeManager.OnPostTick += UpdateCineMachine; } to update the cinemachine.

Note - Update cinemachine after Reconcile step happened in player controller.

@liugoudanzi
Copy link
Author

You can create a script which updates cinemachine like public void UpdateCineMachine() { cinemachineBrain.ManualUpdate(); }

Then you can use TimeManager.OnPostTick action provided by Fishnet in PlayerController's OnStartNetwork callback like public override void OnStartNetwork() { TimeManager.OnPostTick += UpdateCineMachine; } to update the cinemachine.

Note - Update cinemachine after Reconcile step happened in player controller.

The jitter problem should be fine but now the rotation problem

2025-01-13.15-21-03_2025113152146.mp4

@FirstGearGames
Copy link
Owner

This is most likely a help request rather than a bug report. We have some new prediction demos in 4.5.8 that might help. There's also new smoothers coming into testing today; see discord for announcement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants