Skip to content

fix: Provide SpawnWithObservers property alternative to CheckObjectVisibility [MTT-6353] #2568

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

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented May 23, 2023

This PR provides users with an alternate way to handle spawning NetworkObjects with no observers via the NetworkObject.SpawnWithObservers property (default is true). This will help to avoid issue #2546 where using a CheckObjectVisibility handler that always returns false (i.e. never is changed) would result in NetworkShow not being able to function correctly.

MTT-6353

Changelog

  • Added: NetworkObject.SpawnWithObservers property (default is true) that when set to false will spawn a NetworkObject with no observers and will not be spawned on any client until NetworkObject.NetworkShow is invoked.

Testing and Documentation

  • Includes integration test NetworkObjectOnSpawnTests.ObserverSpawnTests.
  • Documentation was updated (PR-1060)

Providing a way for users to specify that a NetworkObject should not spawn with any observers without having to use CheckObjectVisbility as a "global" way to handle this as it conflicts with NetworkShow if the CheckObjectVisbility handler always returns false.
Test that validates the changes.
adding changelog entry.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review May 23, 2023 19:55
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner May 23, 2023 19:55
@NoelStephensUnity NoelStephensUnity merged commit 706c6b4 into develop May 23, 2023
@NoelStephensUnity NoelStephensUnity deleted the fix/provide-spawnwithobservers-propery-for-checkobjectvisibility-issue-mtt-6353 branch May 23, 2023 21:31
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.

2 participants