TextButtons positon wont change

Im trying to make a script for a fnaf-ish camera system. The script uses 3 textbuttons that detect the players cursor tweening it to a certain positon.

Im trying to move the textbutton in the middle to the right so that it dosen’t get in the way for the player, and set the textbutton visibility of the textbutton that was originally on the right to false.

local Camera = workspace.CurrentCamera
local Views = workspace:WaitForChild("Views")
local tweenService = game:GetService("TweenService")
local Button = script.Parent
local ButtonMain = game.StarterGui.View.Main
local ButtonRight = game.StarterGui.View.Right

function tweenCamera(pos,tweenTime)
	tweenService:Create(Camera,TweenInfo.new(tweenTime,Enum.EasingStyle.Sine), {CFrame = pos.CFrame}):Play()

	if tweenCamera(Views.ViewLeft, 1) then
		ButtonRight.Visible = false
		ButtonMain:TweenPosition(UDim2.new(0.903, 0, 0, 0), "Out", "Sine", 0.4)

I tried to do this by Tweening the buttons position, but it doesn’t seem to work.

Why not player’s GUI using script.Parent.Parent or something?

1 Like

:Play() the animation

or the tween wont play

I had it there before, think I removed it accidentally while editing the script.

Even now after adding :Play() back in, It still isn’t working.