I'm fairly new to FishNet and have been struggling to convert my project over from Unity Multiplayer. Please help!
Background:
- Migrating from Unity Multiplayer to FishNet + FishyEOS
- Using custom pooling system and scene management
- Need to share code between networked and local gameplay
Environment:
- Unity: 6000.2.0b3 (Unity 6 Beta)
- Windows 11
- FishNet: 4.6.8
- FishyEOS: [Using FishNet.Transporting.FishyEOSPlugin]
Objective:
Spawn NetworkObjects dynamically in specific scenes with ability to reparent them, while ensuring proper client synchronization.
Current Approach:
var flag = Object.Instantiate(_prefab, transform, true);
// If network game and we're host, spawn on network
if (_networkManager && _networkManager.IsHost)
{
_networkManager.Spawn(flag.gameObject);
Log($"PlaceOneFlag - Network spawned flag {i}");
}
Issue:
- When
NetworkObject._isGlobal = true: Objects spawn correctly on clients but automatically get moved toDontDestroyOnLoad, preventing scene-specific placement and reparenting - When
NetworkObject._isGlobal = false: Objects don't propagate to clients at all, and renderer gets disabled on host
Desired Behavior:
- Objects should spawn in the current scene (not moved to DontDestroyOnLoad)
- Objects should be visible and synchronized across all clients
- Objects should remain reparentable after network spawn
Key Questions:
- Is there a way to spawn scene-based NetworkObjects (
_isGlobal = false) that properly synchronize to clients when using custom scene management? - What's the recommended pattern for dynamic spawning with
Object.Instantiate()+NetworkManager.Spawn()when not using FishNet's default scene loading?
Additional Context:
- Have custom scene management system, not using FishNet's built-in scene loading
- I'm using Addressables for all scenes apart from bootstrap
- Objects need to be spawned dynamically during gameplay, not pre-placed in scenes