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

Why isn't it changing the perspective of the player?

local text1 = "Player Perspective?"
local text2 = "Camera Perspective?"
local button = script.Parent.Perspective

local function OnClick()
    -- PlayerPerspective --
	if button.Text == text1 then
		local Camera = game.Workspace.CurrentCamera
		local plr = game.Players.LocalPlayer

		Camera.CameraType = "Follow"
		Camera.CFrame = plr.Character.Head.CFrame
		
		button.Text = text2
	end
	-- CameraPerspective --
	if button.Text == text2 then
		local Camera = game.Workspace.CurrentCamera
		local plr = game.Players.LocalPlayer
		
		Camera.CameraType = "Scriptable"
		Camera.CFrame = game.Workspace.CamPart.CFrame
		
		button.Text = text1
	end
end

button.MouseButton1Click:Connect(OnClick) -- Make sure not to type OnClick()! Pass the function, don't run it!

I'm not getting errors at all, and this is a local script inside of a screen GUI that is inside of starter GUI. Please help! (btw, a dude helped me already. If you see this then tell me your username and I'll give credit.)

Thanks,

Narwhal

1 answer

Ok, I see the problem. What I would do is not use `Camera.CameraType = "Follow Camera.CFrame = plr.Character.Head.CFrame'

I think you can just put the camera as "Fixed" and instead of Camera.CFrame do Camera.CamerSubject

Hope I could Help!

2 comments

0

let me go see if it works, thanks for your contribution!

0

Unfortunatly, It didn't work. Sorry! Also, there was no errors

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