A while ago this thread was started asking the same question:
but is no longer open for replies.
Why can’t Unity support LoadSceneParameters in Addressables?
We’re using Photon Fusion, and loading scenes there requires local physics per scene.
Currently the only workaround seems to be creating an empty scene and moving game objects from the Addressable scene into it.
But surely the Addressable team could add support for LoadSceneParameters?
Yes this is in 1.20.0. Due to a change in API required to add the SceneLoadParameters, we cannot release the change in 1.19.X.
I do not yet have an accurate timescale of when 1.20 will be release unfortunately. I will update this ticket when we have a reasonable estimate for 1.20.0
I’m also here with the same need because of physics with Fusion. @CDF are you using the workaround of moving objects into your own newly created scene for now?
Addressables supports all LTS versions of the Editor.
1.20 however may not be verified with our systems for 2019lts and may have to be input manually. For 2021.3 you should be able to see the version in the package manager when available.
Sorry I missed this. Kindof, I was using a custom SceneProvider script. Had to use a AssemblyDefinitionReference so I had access to the internals of Addressables. Here was the script I’m using:
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceLocations;
using UnityEngine.SceneManagement;
namespace UnityEngine.ResourceManagement.ResourceProviders {
/// <summary>
/// Temporary fix for loading Addressable scenes in Fusion with multi-peer.
/// There's still an issue in Addressables 1.20.0 where Addressables doesn't actually provide the loadSceneParameters!
/// https://discussions.unity.com/t/859999
/// </summary>
/// <author>Chris Foulston</author>
public class FusionSceneProvider : SceneProvider, ISceneProvider2 {
#region Public Methods
public new AsyncOperationHandle<SceneInstance> ProvideScene(ResourceManager resourceManager, IResourceLocation location, LoadSceneParameters loadSceneParameters, bool activateOnLoad, int priority) {
loadSceneParameters.localPhysicsMode = loadSceneParameters.loadSceneMode == LoadSceneMode.Additive ? LocalPhysicsMode.Physics3D : LocalPhysicsMode.None;
return base.ProvideScene(resourceManager, location, loadSceneParameters, activateOnLoad, priority);
}
#endregion
}
}
Makes the assumption that if scene load mode is additive, then use LocalPhysics3D