Class IPlayerCharacterExtensions
Convenience accessors derived from IPlayerCharacter's own state.
public static class IPlayerCharacterExtensions
- Inheritance
-
IPlayerCharacterExtensions
- Inherited Members
Methods
CurrentSceneName(IPlayerCharacter)
The name of the scene the character is physically standing in.
public static string CurrentSceneName(this IPlayerCharacter character)
Parameters
characterIPlayerCharacterCharacter to inspect.
Returns
- string
The instance scene name when inside an instance; otherwise the world scene name.
Remarks
Not the same thing as SceneName. While a character is
inside an instance, SceneName keeps naming the open-world scene it will return
to — that is what makes the return trip possible — and the scene it is actually in is
InstanceSceneName. Reading SceneName where this
was meant has been the same bug several times over: teleporters inside a dungeon
could never fire because the wrong scene's teleporter list was consulted, and every
interactable handler's "is this a known scene?" check was answered about a scene the
character had left.
This names a scene, so it still cannot distinguish one instance of a scene from
another — scene stacking means several share a name. Anything that needs instance
identity within this process must compare GameObject.scene.handle, and
anything that needs it across processes must use the scene row id. See
SceneHandle.