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

Custom Camera Type not working - what do I do?

I am trying to create a script to move the camera around an object. Everything works fine until I try to give the control of the camera back to the player - I set the camera type to Custom however the camera does not move around the player as it should. Every other camera type (Follow, Track, Attach etc.) will work, just not Custom. What is the problem here.

connection = game:GetService("RunService").Heartbeat:Connect(function()
	if i < 360 then
		camera.CFrame = CFrame.new(target.Position)
				  * CFrame.Angles(0, angle, 0)
				  * CFrame.new(0, 10, 50 + 30 * math.sin(math.rad(i/2)))
		angle = angle + math.rad(0.5)
	
		i = i + 0.5
	end

	if i >= 360 and i < 420 then
		i = i + 1
	end

	if i >= 420 and i < 480 then
		camera.CFrame = camera.CFrame:lerp(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0, 2.5, 10), 0.1)
		i = i + 0.5
	end
	
	if i >= 480 then
		camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
		camera.CameraType = Enum.CameraType.Custom -- every other type works fine
		
		connection:Disconnect()
	end
end)

3 comments

0

Hi ik you have a little something if yours going on but, i asked a question about the same as yours in camera manipulation, could you help me on my question, im having trouble getting the camera?

0

Is this your default CameraScript or a LocalScript that disables CameraScript upon connection?

0

? It's an ordinary LocalScript within StarterPlayerScripts

1 answer

I figured it out. The script was called "CameraScript", which means that the default camera control script gets overriden. I solved it by changing the name to something that is not "CameraScript."

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