Hello I was trying to make a PlayGui where when you join it shows you the whole map to see, and if you press Play it will destroy the Gui and move your camera to original state and play around, but my problem is it shows a error which I don't like seeing in the Output box. If someone could help me or just link a Camera thread that would help.
They are all Local Scripts and also heres the Error message prnt.sc/1qogb4y, if you don't trust links heres the message in text:
14:29:53.142 CFrame is not a valid member of Model "Workspace.Templvte" - Studio
14:29:53.142 Stack Begin - Studio
14:29:53.143 Script 'Players.Templvte.PlayerGui.PlayGui.Frame.PlayButton.Play', Line 14 - Studio
14:29:53.143 Stack End - Studio
Here are the script I used to make my Play work:
In the Play Button:
-- Locals: local Button = script.Parent local Camera = workspace.Camera local Player = game.Players.LocalPlayer Button.MouseButton1Click:Connect(function() if Player.PlayerGui:FindFirstChild("PlayGui") then Player.PlayerGui.PlayGui:Destroy() end Camera.CameraType = Enum.CameraType.Custom Camera.CameraSubject = Player.Character Camera.CFrame = Player.Character.CFrame Camera.CameraType = Enum.CameraType.Fixed end)
Don't know if you need how I get into the Camera state but also heres the script:
-- Locals: local Camera = workspace.Camera Camera.CameraType = Enum.CameraType.Scriptable Camera.CameraSubject = workspace.Cameras.SpawnCamera Camera.CFrame = workspace.Cameras.SpawnCamera.CFrame
If you could improve or just tell me why it makes the error thats fine with me.
The model instance doesn't have a property called CFrame, unlike Baseparts.
So like ChristianTRPOC, said set a PrimaryPart in your model and change the CFrame of the PrimaryPart.
The way I'd do this is to insert a Part into my model and position it to the center of the model and change the Transparency to 0, CanCollide to false, and Anchor to true.
local model1 = workspace.Model local model1CFrame = model1.PrimaryPart.CFrame