-
What do you want to achieve?
I want to tween my frame -
What is the issue? Include screenshots / videos if possible!
The frame’s position isn’t changing on the client.
The module function prints this when the tween is done: “{0.5, 0}, {0.0700000003, 0} - Client”
The client prints this right after calling the module function: “{0.5, 0}, {0.0700000003, 0} - Client”
But I don’t see my frame tweening at all.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried to rewrite the script as much as I could but it still doesn’t work. Also checked the dev forum but most of them were variables or typos mistake.
This is my client script:
-- Moves the UI top and down
topUiMovesEvent.OnClientEvent:Connect(function(variable)
-- moving the ui up
if variable == "up" then
tweenModule.TweenTopAnnouncementText(topAnnouncementText, "Up")
print("Up")
-- moving the ui down
elseif variable == "down" then
tweenModule.TweenTopAnnouncementText(topAnnouncementText, "Down")
print("Down")
print(topAnnouncementText.Position)
else
print("There was an issue with the demand")
end
end)
This is my module script:
-- Tween top Text
tweenModule.TweenTopAnnouncementText = function(frame, variable)
-- Tween Variables
local tweenTime = 0.75
-- Tween Goals
local tweenUpGoal = UDim2.new(0.5, 0, -0.1, 0)
local tweenDownGoal = UDim2.new(0.5, 0, 0.07, 0)
-- If it's up, it goes up, if it's down it goes down
if variable == "Up" then
-- Making the tween
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local tweenGoal = {Position = tweenUpGoal}
local tween = tweenService:Create(frame, tweenInfo, tweenGoal)
-- Hides the frame before tweening (so the player doesn't see the frame go up)
frame.Visible = false
print("Up")
tween:Play()
elseif variable == "Down" then
-- Making the tween
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local tweenGoal = {Position = tweenDownGoal}
local tween = tweenService:Create(frame, tweenInfo, tweenGoal)
print("Down")
frame.Visible = true
tween:Play()
tween.Completed:Wait()
print(frame.Position)
else
warn("There was an issue with the top announcement variable name")
end
end
I just want to know the issue on why is my frame not tweening at all. I believe it’s a really easy fix but even after hours I can’t figure what is it.
Edit: Cleaner explaination