Passing input ownership? #205
-
I have enterable vehicles in my game that can be entered and driven by any player providing they are empty. Currently, I've implemented this by having the vehicles as character controllers with RollbackSync and an Input. The server owns all empty vehicles and when a player enters one the server gives ownership of the input to the player and they are now in control. When they exit the server takes that control back. I'm calling I've seen the docs basically say don't do this and I can see the code basically performs a big wipe on states. I'm wondering what might be a better way of doing this ownership pass-across? Would a PR for a smoother ownership handoff method be welcome? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @albertok, Is the stutter in timing only ( i.e. game freezes for a little bit ), or is it also in state ( i.e. vehicle or player jumps around )? If it's only the former, that could be because of #175, which will be fixed soon by #204. If it's not too much hassle, I'd be happy to hear from you if that version works better for your case. IIRC the original consideration for not recommending If you'd like to contribute with a PR, that is very welcome! I can also get around to it some time this week. |
Beta Was this translation helpful? Give feedback.
Hi @albertok,
Is the stutter in timing only ( i.e. game freezes for a little bit ), or is it also in state ( i.e. vehicle or player jumps around )? If it's only the former, that could be because of #175, which will be fixed soon by #204. If it's not too much hassle, I'd be happy to hear from you if that version works better for your case.
IIRC the original consideration for not recommending
process_settings()
during gameplay is for cases where people change the properties being synced. That could cause issues that I did not want to support at the time 🙂 But for authority changes I expect it to be fine. A separate method would be the best, for ownership changes only - that way we can also …