Help With Monitoring Unrendered Players

Hello! I am working on implementing a “watch” admin command for our game, which features a large map and has streaming enabled to minimize lag. This command allows moderators to monitor users in the game.

Currently, the implementation simply changes the CameraSubject of the workspace’s current camera to the target player’s humanoid. While this works effectively when players are rendered and within range, the camera fails to switch to the target player when they move a considerable distance away and become unrendered.

Here’s the relevant code snippet for the current implementation:

local function watchTarget(player, target)
	local camera = Workspace.CurrentCamera
	camera.CameraSubject = target.Character
end

I’ve observed that when a player becomes unrendered, their position and humanoid parts are no longer visible in the workspace, making it impossible to reference their location. To address this issue, I was wondering if it’s feasible to move the camera to the target player’s position, thereby rendering that area while simultaneously unrendering the area where the moderator is executing the command.

I would greatly appreciate any suggestions or modifications to ensure that moderators can still observe unrendered players from a distance. Thank you!

1 Like

If you’re unable to get the positions of the unrendered players, you may need to use a RemoteFunction and request the target player’s position from the server. From there, you could try moving the player’s camera to the target location.

If the content isn’t streamed in when you move the player’s camera, then you might have to explicitly request that the content be streamed in via RequestStreamAroundAsync.

You can also try changing the player’s ReplicationFocus to the target player’s part (maybe?) but that must be handled server-side. I haven’t used these APIs before so I don’t know 100% what they’re capable of.

1 Like

Thank you so much, using RequestStreamAroundAsync did the trick.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.