Help with moving GUI

So I want to make this ui come from the left hidden screen, to the left seen screen
Like this
Before:

After:

This is the code I have tried

ObjectiveTimeEvent.OnClientEvent:Connect(function(timer)
	ObjectiveEvent.OnClientEvent:Connect(function(objective)
		ScreenGui.ObjectiveFrame.ImageLabel.TextLabel.Text = objective
		ScreenGui.ObjectiveFrame.Visible = true
		object.Position = UDim2.new(-0.2, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new (0, 0, 0.5, 0))
		wait(timer+1)
		object.Position = UDim2.new(0, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new (-0.2, 0, 0.5, 0))
		ScreenGui.ObjectiveFrame.Visible = false
		
	
	end)
end)

Thanks!

1 Like

Please Help! I’ve been struggling with this for so long

does it need to stay on screen for a certain time then disappear?

Exactly, so after 20 seconds, the UI dissapear!

Anyone can help me pls? I really struggle with this

does it need to be shown when you touch a part?

Nope, its a remote event so I need to trigger it

Oh Gosh dang it, I dont post the full code, so sorry

Anyway, here it is

local player = game.Players.LocalPlayer
local ObjectiveEvent = game.ReplicatedStorage.Remotes.ObjectiveEvent
local ScreenGui = player.PlayerGui.MainGui
local ObjectiveTimeEvent = game.ReplicatedStorage.Remotes.ObjectiveTimeEvent
local object = game.StarterGui.MainGui.ObjectiveFrame
object.AnchorPoint = Vector2.new(0.5, 0.5)




	ObjectiveTimeEvent.OnClientEvent:Connect(function(timer)
		ObjectiveEvent.OnClientEvent:Connect(function(objective)
			ScreenGui.ObjectiveFrame.ImageLabel.TextLabel.Text = objective
			ScreenGui.ObjectiveFrame.Visible = true
			object.Position = UDim2.new(-0.2, 0, 0.5, 0)
			wait(2)
			object:TweenPosition(UDim2.new (0, 0, 0.5, 0))
			wait(timer+1)
			object.Position = UDim2.new(0, 0, 0.5, 0)
			wait(2)
			object:TweenPosition(UDim2.new (-0.2, 0, 0.5, 0))
			ScreenGui.ObjectiveFrame.Visible = false
			
		
		end)
	end)

SO SORRY!

i advise you put the original position of the object to (-,2,0,.5,0)
and then just do

local player = game.Players.LocalPlayer
local ObjectiveEvent = game.ReplicatedStorage.Remotes.ObjectiveEvent
local ScreenGui = player.PlayerGui.MainGui
local ObjectiveTimeEvent = game.ReplicatedStorage.Remotes.ObjectiveTimeEvent
local object = game.StarterGui.MainGui.ObjectiveFrame
object.AnchorPoint = Vector2.new(0.5, 0.5)

local ts = game:GetService("TweenService")

local TI = TweenInfo.new(.4,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,-1)

local Tween1 = ts:Create(object, TI, {Position= UDim2.new(0,0,0.5,0)})

local Tween2 = ts:Create(object, TI, {Position= UDim2.new(-0.2,0,0.5,0)})

	ObjectiveTimeEvent.OnClientEvent:Connect(function(timer)
		ObjectiveEvent.OnClientEvent:Connect(function(objective)
			ScreenGui.ObjectiveFrame.ImageLabel.TextLabel.Text = objective
			ScreenGui.ObjectiveFrame.Visible = true
Tween1:Play()
Task.wait(timer+1)
Tween2:Play()

ScreenGui.ObjectiveFrame.Visible = false
end)
end)
1 Like

I will try this, thank you so much!

Nope, not working, idk whats wrong

can you show us a clip of what happens when you fire the events using you first code

1 Like

wait a second, I just realize something really really weird

what
???

1 Like

Look at this picture


the image label look over there, but there is nothing show up, I dont do transparency 1, or visible = false

U did make it invisible.

ScreenGui.ObjectiveFrame.Visible = false

At the end

1 Like

I redo the code with this code:

local player = game.Players.LocalPlayer
local ObjectiveEvent = game.ReplicatedStorage.Remotes.ObjectiveEvent
local ScreenGui = player.PlayerGui.MainGui
local ObjectiveTimeEvent = game.ReplicatedStorage.Remotes.ObjectiveTimeEvent
local object = game.StarterGui.MainGui.ObjectiveFrame
object.AnchorPoint = Vector2.new(0, 0.5)

ObjectiveTimeEvent.OnClientEvent:Connect(function(timer)
	ObjectiveEvent.OnClientEvent:Connect(function(objective)
		object.Transparency = 0
		object.Visible = true
		object.ImageLabel.TextLabel.Text = objective
		object.Position = UDim2.new(-0.2, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new(0, 0, 0.5, 0))
		wait(timer)
		object.Position = UDim2.new(0, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new(-0.2, 0, 0.5, 0))
		
	
	end)
end)

this work pretty well, but the image not showing up like my recent post

it is BackgroundTransparency

local player = game.Players.LocalPlayer
local ObjectiveEvent = game.ReplicatedStorage.Remotes.ObjectiveEvent
local ScreenGui = player.PlayerGui.MainGui
local ObjectiveTimeEvent = game.ReplicatedStorage.Remotes.ObjectiveTimeEvent
local object = game.StarterGui.MainGui.ObjectiveFrame
object.AnchorPoint = Vector2.new(0, 0.5)

ObjectiveTimeEvent.OnClientEvent:Connect(function(timer)
	ObjectiveEvent.OnClientEvent:Connect(function(objective)
		object.BackgroundTransparency = 0
		object.Visible = true
		object.ImageLabel.TextLabel.Text = objective
		object.Position = UDim2.new(-0.2, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new(0, 0, 0.5, 0))
		wait(timer)
		object.Position = UDim2.new(0, 0, 0.5, 0)
		wait(2)
		object:TweenPosition(UDim2.new(-0.2, 0, 0.5, 0))
		
	
	end)
end)

i tryied and this is working for me maybe you are tweening the wrong ui

1 Like

Nope, still the exact same result

I DONT think its because the image not loading, cuz the text is not showing there too