Why Is My Gui's Position Not Changing?

Im Trying to make a “cool” gui animation,
so what it’s supposed to do is,is has to slide on the screen and then slide back off the screen.
but the script didn’t work.
script:

local Notif = script.Parent.Buttons.Notification
	Notif.Visible = true
	Notif:TweenPosition(
		UDim2.new({0, 0},{0.087, 0}),
		Enum.EasingDirection.In,
		Enum.EasingStyle.Back,
		3,
		false,
		false
	)--This is only the slide on the screen part because this is the one that doesn't work...

i don’t know what’s the problem(im new with ui ).
Thanks in Advance!

No need to use tables for udim just use this instead.
UDim2.new(0, 0,0.087, 0),

it still says "Unable To Cast Value To Function
Stack Begin–Client

Script
‘Players.Scavengingbot.PlayerGui.Gui’, Line 17

Stack End"
How do i Fix That Kind Of Bugs?

Unfortunately the Back easing style doesn’t do what you think it does.

you COULD make another tween position with the out of screen position, or you could use the actual TweenService for this

TweenInfo has an argument called Reverses.


it reverses the tween once it completes

Isn’t The TweenService Only For Parts?

local __TWEENSERVICE = game:GetService("TweenService")
local __NOTIF = script.Parent.Buttons.Notification
__NOTIF.Visible = true
__TWEENSERVICE:Create(__NOTIF, TweenInfo.new(3, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Position = UDim2.new(0, 0,0.087, 0)}):Play()

Rewrote your snippet.

TweenService works with everything that has a property.

You can use TweenService for anything! not just parts

an example of a gui (with anchor point .5, .5) tweening to the middle of the screen

local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(TimeToComplete, EasingStyle, EasingDirection, RepeatCount, Reverses, DelayTime)
local Properties = {
  Position = Udim2.new(0.5, 0, 0.5, 0);
}

local Tween = TweenService:Create(inst, TweenInfo, Properties)

The Properties table has all of the end points of the tween, index being the property name and value being the ending value

lets say I wanted a part to smoothly change color to green and go to the center of the world, the Properties table would look like this

{
   Color = Color3.fromRGB(0, 255, 0);
   CFrame = CFrame.new(0, 0, 0);
}

lets say I wanted a numbervalue to tween to the value “7”

{
   Value = 7;
}

lets say I wanted a sound to fade into nonexistance

{
   Volume = 0;
}
1 Like

Well Now it just doesn’t even come on screen…
so i changed it so instead of reverse boolean (because if i add a delaytime it breaks)
i added two tweens to play

__TWEENSERVICE:Create(Notif,Tweninf,{Position = UDim2.new(0, 0,0.087, 0)}):Play()
		wait(5)
		__TWEENSERVICE:Create(Notif,Tweninf,{UDim2.new(-0.206,0,0.104, 0)}):Play()

BUT ofcourse there’s a problem…
the second one breaks
“Unable to cast value blalalalallalalal”
it starts to annoy me.

So If That’s True Then Can You tween the Text property?
because i’ve always wondered how devs make those dialog animations where every
letter comes individually,
instead of the text just appearing.

Here you go UI Animations | Roblox Creator Documentation

1 Like

You forgot to define Position.
__TWEENSERVICE:Create(Notif,Tweninf,{Position = UDim2.new(-0.206,0,0.104, 0)}):Play()

2 Likes

oh…well
Thank you
it works now, im dumb hahah

unfortunately no, the things you can tween are a bunch of numeric things (sorry I said anything lol), the way they do that is altering the MaxVisibleGraphemes value in TextBoxes and use some string formatting goofiness to factor in rich text.

1 Like

ohhh ok somebody gave me the link to the creator documentation.
(i still don’t understand the code fully)
it seems quite hard to do actually.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.