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

Camera cframe not changing???

So I have a Menu gui, and when a player joins the game their camera's cframe is set at a spot I made for the menu backround. One of the Textbuttons in the menu frame is a character customization button that upon getting clicked will teleport the character to a room (where you customize your character), and also sets the camera's cframe directly in front of where the character gets teleported to. Usually the customize textbutton script works (without having the menu camera set tho), but if the menu camera cframe is active then it wont change to the customization cframe. Here is the script: https://pastebin.com/raw/SsERCQ9A

the script goes in a localscript inside the customization button.

5 comments

0

Please use scripting helpers built-in code format.

0

I would, but im kinda new to this and don't know how.. How do I use that?

0

There's a lua code block button right above the box where you write your question.

0

Ok ty, and also can you answer my question about the camera?

0

It's working for me.

1 answer

I'll help you fix up performance issues, because I just can't look at it.

-- Contstants -- 

local Camera = game.Workspace.CurrentCamera 
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() -- this is better than the 
-- repeat wait loop

-- Camera -- 

script.Parent.MouseButton1Click:Connect(function() --:connect is deprecated, use :Connect
	Camera.CameraType = Enum.CameraType.Scriptable
	
	Camera.CFrame = game.Workspace.CustomizePart.CFrame
	script.Parent.Parent.Parent.CC.Visible = true
	script.Parent.Parent.Visible = false
	if Player.Character and Player.Character:FindFirstChild("Left Leg") then
		Player.Character["Left Leg"].CFrame = CFrame.new(160.187, -264.502, 184.327)
		print("found the part!")
	end
end)

I used an R6 rig for it, however, you'll be fine changing up the Part.

This script worked for me, if you have any issues, comment below!

2 comments

0

Thanks for trying, but for me sadly the camera cframe still isn't changing...

0

That's very odd, I tried the script and it worked. Are you sure it's a button that the scirpt is parented under?

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