Question about property syncing without ownership #219
-
Hi, I have a Netfox project with 3d player movement. The movement script changes the player's rotation but ownership blocks it from turning. How would I go about solving this? (Sorry if this is formatted improperly. I'm new to github) Below is the project. |
Beta Was this translation helpful? Give feedback.
Answered by
elementbound
Apr 8, 2024
Replies: 1 comment 2 replies
-
Hey @Netherite1701, thanks for attaching a project, much appreciated! Which scene should I look at? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I looked into it and I get what's your issue - the head rotation is synchronized by a
MultiplayerSynchronizer
node, but it gets reset on clients, because the player avatar's owner is the server.I would recommend moving the mouselook logic to the rollback loop, same as with player movement.
To do so, gather the mouse movement into a property on
PlayerInput
. Then, in the player's _rollback_tick, apply that. Make sure to configure both the mouse input and the player- and neck rotation as input and state properties in theRollbackSynchronizer
.This would also mean that the mouselook would be tied to the network tickrate even for the local player. To counteract this, you should be able to…