Skip to content

Conversation

@vakuor
Copy link

@vakuor vakuor commented Oct 29, 2023

Fixes #3528.
Fixes #3529.
Closes #3530.

This fix changes behaviour of NetworkBehaviour.authority property to return true while you are host and has authority over object.

If server and syncDirection is ServerToClient - return true, otherwise false.
If client and syncDirection is ClientToServer and object is owned - return true, otherwise false.

This condition is more readable than the old one and is still fast.

Still there an possible usage error while on the server you are trying to use OnStartAuthority or OnStopAuthority since you have an authority. To fix this we need to allow usage of OnStartAuthority and OnStartAuthority on server. Maybe it is related to #3495.

@vakuor vakuor marked this pull request as draft October 29, 2023 14:21
@vakuor vakuor marked this pull request as ready for review October 29, 2023 14:22
@miwarnec
Copy link
Collaborator

fixed, thanks

@miwarnec miwarnec closed this Oct 29, 2023
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

Successfully merging this pull request may close these issues.

NPC SyncDirection .authority is false hasAuthority is false for NPCs

2 participants