I want to continuously set the Cframe of the camera to the cframe of the part

elevatorEvent.OnClientEvent:Connect(function(elevator)
	exitBtn.Visible = true
	camera.CameraType = Enum.CameraType.Scriptable
	
	**while wait(0.0001)do**
**		camera.CFrame = game.Workspace.Elevator.Camera.CFrame**
**	end**
	
end)

HELP I want to continuously set the Cframe of the camera to the Cframe of the part
but it just sets it once when function starts.

The while wait do loop never ends once the function fires. Also, wait(0.0001) isn’t a good way of doing this. You should use task.wait() since () equals about 0.03 seconds minimum anyway. This means wait(0.0001) can only ever wait(0.03).

Are you trying to always set the CFrame of the camera to the Part, or do you want it to change from Scriptable back to normal when something happens?
Try a repeat until loop and check to see if the player leaves the elevator (I’m just guessing about this) and if they do then reset the camera back to normal.

bro i think i fixed that but how can I hang a single part without anchoring it

that somehow fixed it bro
tysm

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