Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

:TweenPosition instead of just Position?

Asked by 8 years ago
Edited 8 years ago
01--\\ Services
02local ReplicatedStorage = game:GetService'ReplicatedStorage'
03--\\Nicknames and Tables
04local ply = script.Parent.Parent or game.Players.LocalPlayer
05local Event = ReplicatedStorage.ChatEvent
06local Messages = {}
07--\\ Functions
08local function TweenPushMessages(Size)
09    for i,v in pairs (Messages) do
10        v.Position = v.Position - UDim2.new(0,0,0,Size)
11    end
12end
13--\\FireServerFunction
14ply.Chatted:connect(function(msg)
15    if msg ~= '' then
View all 29 lines...

The function TweenPushMessages is where I'm trying to do it, but I know it wouldn't work, would there be a way to recreate it with TweenPosition instead?

1 answer

Log in to vote
1
Answered by
KarlXYZ 120
8 years ago
Edited 8 years ago
1local function TweenPushMessages(Size)
2for i,v in pairs (Messages) do
3        v:TweenPosition(v.Position - UDim2.new(0,0,0,Size), "Out", "Quad", 0.5)
4    end
5end

Replace the 0.5 with the duration of the tween.

You can also try different easing styles too.

Ad

Answer this question