Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I get the PLAYER'S camera?

I am trying to create a kind of stealthy game and I need a way to make my characters shimmy across ledges/walls. While the people are shimmying across these walls, I need the camera to be stationed in a third person type way. This is the code I have, but when I try it out in the server, it takes the Server's camera instead of the characters. It was actually quite funny to watch, but nonetheless, I don't know how to get the person's camera when touching the brick. Here is my code.

local part = script.Parent

local debounce = false

part.Touched:connect(function(hit)
	wait(.5)
	local character = hit.Parent:findFirstChild("Humanoid")
	if character and debounce == false then
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player and debounce == false then
		debounce = true
		wait(.1)
		
		local cam = workspace.CurrentCamera

cam.CameraSubject = workspace.Cam

cam.CameraType = "Attach"

cam.CoordinateFrame = CFrame.new(-30.1, 5.8, -81.1)

cam.Focus = CFrame.new(-30.1, 5.8, -93.1)
		
	end
	end
end)

1 answer

Camera manipulation is client-only, so you will have to either signal the client to alter the cameras, or have the clients detect it; the server cannot directly alter the camera.

1 comment

0

How can I signal the client To alter the cameras? I've been researching cameras for a while now and I've been on this website [http://wiki.roblox.com/index.php?title=Camera_manipulation] but this website is giving me instructions on player added, I don't want the camera to be manipulated on player added, can you give me an example of a way to signal the client on player touched?

This discussion is preserved as it was. New answers, comments, and votes are closed.