PlayerMockUtils
Mock identity: recognizing one, and finding the ones in the DataModel. Tag resolution is DataModel-scoped, so a mock is discoverable the moment it is parented in.
Every other helper guards its arguments with PlayerMockUtils.isMock, so this module stays a leaf -- discovery keyed by a value only another helper can read lives with that helper instead (see PlayerMockPlayerServiceUtils.getPlayerByUserId and PlayerMockCharacterUtils.getMockFromCharacter).
Functions
isMock
PlayerMockUtils.isMock(value: any) → booleanRequiring the backing Folder rejects a foreign instance merely carrying the tag.
Use PlayerMock.isMock.
findFirstAncestorMock
Like the engine call it walks from the parent, so instance itself is never returned.
getMocks
Returns the mocks currently in the DataModel.
Use PlayerMock.getMocks.
getMockAddedSignal
The PlayerMockUtils.isMock guard is applied before the signal fires, so it only ever hands back a genuine mock.
getMockRemovingSignal
Fires whether the mock was destroyed or merely unparented.
getMockedLocalPlayer
Returns the mock designated as the local player, or nil.
observeMockedLocalPlayer
Observes the mock designated as the local player (see PlayerMock.setMockedLocalPlayer), emitting
the current designation on subscribe and again whenever it changes. This replaces one-shot reading
PlayerMock.getMockedLocalPlayer, which goes stale when a test designates after the consumer
initializes (designation is only required before bags Start, not before Init). Like the getter,
this only ever emits the mock -- the real Players.LocalPlayer fallback stays an explicit read at
the call site.
Re-designating from one mock to another emits nil in between: the designation is carried as a CollectionService tag on the mock, and the switch removes the old tag before adding the new one.