Hey devforum members! So I was working on my piggy game where I encountered an error, the script was something to do with cam manipulation and when you press the textbutton the camera would go from one part to the next. Here is the script and if you can point out any errors that would be great! local camera = workspace.CurrentCamera
local mainMenuMap = workspace:WaitForChild("MainMenuMap")
local tweenService = game:GetService("TweenService")
local btn = script.Parent
function tweenCamera(pos,tweenTime)
tweenService:Create(camera,TweenInfo.new(tweenTime,Enum.EasingStyle.Linear),{CFrame = pos.CFrame}):Play()
end
btn.MouseButton1Click:Connect(function()
btn.Visible = false
btn.Parent.Title.Visible = false
tweenCamera(mainMenuMap.CameraPart2,1)
wait(1)
print("Reached Destination")
end)
I just tried it once again it did not work. I did think it was because I copied the pseudocode from my phone because I scripted it last night and just transfered it over. Turns out that is not why.
You’re not getting any errors in the output window? If the tween isn’t playing, it would be good to check if your script is erroring before you call the tween.
Also, I’ve had a history with tweening failing (with GUIs) but I haven’t had any issues with TweenService before. I’ll look into this.
Can you provide your script that mentions where you set the camera type, from your example it’s not shown. I can’t think of something else that could be restricting it from working properly.
As @xZylter has mentioned, you need to set it by a local script, it’s up to you when you choose to set it for your use case. By default, the camera will be set to custom so it can follow and attach to your character.