#Pooled objects unexpectedly migrate between scenes

8 messages · Page 1 of 1 (latest)

halcyon veldt
#

General
Unity version: 2021.3.18f1
Fish-Networking version: 4.5.4hf0 Pro
Issue: #814
Related: #812

Description
In the example, the server and client load the global game scene.
After the client initializes, both start spawning SimpleBullet every 300ms.
The SimpleBullet is a pooled object that allows for predicting spawn/despawn.
The blue bullet represents is own object, while the grey one represents the other player.

When we go to another global scene you can see bullets that shouldn't be there. We can also change the scene again, and the bullets will still be there.
At the same time, there are no bullets on the server, there is no script that would create them either, and everyone has SceneCondition.

The SceneCondition condition is set in ObserverManager.
All NetworkObjects have a NetworkObserver component with the use Manager parameter.
The spawn logic is the same as here: #812

Replication
Steps to reproduce the behaviour:

  1. Open the "NestedSpawn.Menu" scene in both windows;
  2. Start the Server and Client in one window and Client in other;
  3. Press the "Load Scene" button on Server;
  4. Wait for a few bullets to be re-spawned;
  5. Click to the "Next scene" button;
  6. If no bullets, repeat the loop;

Expected behaviour
Bullets should only be on their own scene and should not migrate.
It seems that there should be no warnings and errors at all, as there is no logic other than spawn and despawn.

azure hearth
#

Are you trying to set them global? I see the IsGlobal warning.

#

How are you spawning them? They will spawn in active scene if not already instantiated, otherwise they should stay in current scene.

halcyon veldt
azure hearth
#

I'm going to close out the bug report for this one and ask you investigate what might be moving them. If it turns out to be FN related let me know here so I can reopen.

#

Recommend checking out the IsGlobal warning too. Warnings should not go ignored unless you know they are safe to ignore.

halcyon veldt