Hello, I’m working on a project which requires the use of tweening. I have watched many tutorials on TweenService and read up on some materials such as:
However I still am having some confusions. The confusions are mostly related to how to do certain types of tweening. I have noticed the articles show tweens of positions, colors, parts, etc… Which makes it hard to learn.
Im trying to Tween a gui using advanced options.
I’m trying to make it so that it tweens at the same SPEED as if the part was close or super far.
for example a tween would make the gui tween slow for something really far away but fast for something close. I want this to be the same speed but I find it complex to find the resources for this.
I’m trying to make a tween right after the initial tween without it getting mixed up by lag etc. I have seen stuff like Tween.Compled:Wait() or something but like i said resources get confusing.
So far what i think i do to tween a gui is
local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(1)
local Position = Udim2.new(0.5,0,0.5,0)
-- i want it the same speed no matter how far it is or close
local PlayThis = TweenService:Create(Script.Parent, TweenInfo, Position)
local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(1)
local Position = UDim2.new(0.5,0,0.5,0)
-- i want it the same speed no matter how far it is or close
local PlayThis = TweenService:Create(Script.Parent, TweenInfo, Position)
So you’re unable to tell me how? Do i have to make some complex math script that calculates the amount of seconds i put or something? Are you sure there’s nothing built in.
local TweenService = game:GetService("TweenService")
local TweenInfo = TweenInfo.new(1)
local Position = {UDim2.new(0.5,0,0.5,0)}
-- i want it the same speed no matter how far it is or close
local PlayThis = TweenService:Create(Script.Parent, TweenInfo, Position)
How do i make the tween play as fast as it would play for an object close or far away? It speeds up when something is close and slows down when something is far
How do i make the tween play as fast as it would play for an object close or far away? It speeds up when something is close and slows down when something is far
Hey for some reason I’m getting the error entitled:
Unable to cast to Dictionary - Client - LocalScript:177
the script is
local Position = UDim2.new(0.725, 0,0.753, 0)
local tweenservice = game:GetService("TweenService")
local Info = TweenInfo.new(2)
local PlayThis = tweenservice:Create(Box,Info,{Position}) -- ERROR HERE
PlayThis:Play()
PlayThis.Completed:Wait()
This is true but it is not good for what I’m trying to do and It’s very bad practice to use. I need to learn how to actually tween and not use noob functions. It’s lazy and embarrassing to use if other scripters or even hackers view your code and will give extreme bad rep. It basically tells anyone who understands code that you don’t understand code.
It’s a supported function, it behaves exactly like normal tweening and it doesn’t show that you “don’t understand code”. I still use it in new projects because its quick and easy, much easier than calling tween service.
Anyways, here is a hopefully working script.
local tweenService = game:GetService("TweenService")
local Info = TweenInfo.new(1)
local PlayThis = tweenService:Create(Path.To.Ui.Object,Info,{ Position = UDim2.new(New.Position.Here) })
PlayThis:Play()
PlayThis.Completed:Wait()