Problem tweening GUI Position

the title just says it all

--//Variables
local Player = game.Players.LocalPlayer
local PlayerGui = Player.PlayerGui
local PlayerCharacter = Player.Character
local HRP = PlayerCharacter:WaitForChild("HumanoidRootPart")
local Camera = game.Workspace.CurrentCamera
--//Components

local MainGui = PlayerGui:WaitForChild("MainMenu")
local PlayerSpawn = game.Workspace.SpawningComponents.PlayerSpawn
local PlayerButtonSpawn = game.Workspace.SpawningComponents.PlayerButtonSpawn
local CameraPart = game.Workspace.SpawningComponents.CameraPart

--//Tweens
local Tween1 = MainGui.FrameContent.Rake:TweenPosition(UDim2.new(0.001, 0,0.152, 0),"Out","Bounce",4,true)
local Tween2 = MainGui.FrameContent.Unknown:TweenPosition(UDim2.new(0.017, 0,0.261, 0),"Out","Bounce",4,true)
--//Scripting
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CameraPart.CFrame

wait(1)
PlayerCharacter.HumanoidRootPart.CFrame = PlayerSpawn.CFrame
wait(2)

Tween1:Play()
Tween2:Play()

error
Players.Tunnells.PlayerGui.MainMenu.local:25: attempt to index boolean with ‘Play’ - Client - local:25

1 Like

The return of a TweenPosition is a Boolean taht determines if the Tween can play or not, if you want to player those 2 tweens where you tried to play them, just put them there

wait(1)
PlayerCharacter.HumanoidRootPart.CFrame = PlayerSpawn.CFrame
wait(2)

MainGui.FrameContent.Rake:TweenPosition(UDim2.new(0.001, 0,0.152, 0),"Out","Bounce",4,true)
MainGui.FrameContent.Unknown:TweenPosition(UDim2.new(0.017, 0,0.261, 0),"Out","Bounce",4,true)

No, that “True” is literally just saying if you can override a tween. So basically if a other tween plays // moves position. It will wait till the tween stops

Quick look at the Documentation of TweenPosition disproves that, it does returna boolean if the tween can play or not, I was not referring to the override argument

image

TweenPosition will run when called immediately. If you want something you can wait to tween, you’ll have to use the typical TweenService:Create or create a function wrapper.

1 Like

Why are you still going on about the override argument? I was never referring to that, I was referring to what TweenPosition returns, which is, again, a boolean that determines if the Tween will play or not. There are certain conditions taht prevent a tween from playing, such as if callback is false and you try to play a tween when it’s already tweening

It’s giving that error specifically because Play is not a function of booleans

Oh. I confused myself sorry.
I was reading it wrong.

1 Like