So I currently have this local script:
local Camera = game.Workspace.CurrentCamera local Player = game.Players.LocalPlayer script.Parent.MouseButton1Down:Connect(function() repeat wait() until Player.Character Camera.CameraType = "Scriptable" Camera.CFrame = game.Workspace.A320.PlaneKit.Plane.Plane.OtherParts.Body.CameraParts.Tail.CFrame script.Parent.Enabled = true end)
So, when you click the button, it goes to a part inside the A320 model. It works and you can see it.
However, when the A320 model moves, it just stays in the same place (the part moves but the playercamera won't.)
I have tried doing loops etc but it does not seem to be working. I'm a bit new to scripting at the moment.
Here is my solution:
local Camera = game.Workspace.CurrentCamera local Player = game.Players.LocalPlayer script.Parent.MouseButton1Down:Connect(function() repeat wait() until Player.Character Camera.CameraType = "Scriptable" spawn(function() -- So the rest of the script doesn't yeld. while wait() do -- Could use RenderStepped:Wait() but this will be fine for now. if not Player.Character then break end -- Breaks the loop if character is removed Camera.CFrame = game.Workspace.A320.PlaneKit.Plane.Plane.OtherParts.Body.CameraParts.Tail.CFrame end end) script.Parent.Enabled = true end)