Help with gui, tween, proximityprompt

hello,
i’m trying to make a gui that will show up with tween transition when the proximityprompt is triggered

local lever = workspace.Lever:WaitForChild("ProximityPrompt")
local frame = script.Parent:WaitForChild("Frame")

local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local direc = UDim2.new(0, 0, -500, 0)

lever.Triggered:Connect(function()
	local tween = TweenService:Create(frame, tweenInfo, direc)
	tween:Play()
end)

lever.PromptHidden:Connect(function()
	frame.Visible = false
end)

it gave me an error saying " Unable to cast to Dictionary - Client - LocalScript:16"

You need to give what property you are trying to tween, in a dictionary. It might look something like:

--Position as an example

local tween = TweenService:Create(frame, tweenInfo, {Position = direc})

this fixed the error, but the gui still not showing up. what’s wrong?

Is the GUI invisible? I noticed you were making it invisible but never making it visible again. Also, what type of script is this and where is it located?

(PromptHidden might be firing on trigger as well)

i removed the promptHidden, and it still won’t work.

yes the gui is visible. i’m using localScript and it’s located inside screengui

Your position is wayyyyy off.

UDim2.new(0, 0, -500, 0)
You’re tweening to 0,0,-500,0
It doesn’t subtract it from the current position.

So -500 would be entirely off the screen

oh yeah that, i’ve changed it to 0.7 still won’t work. the frame won’t move at all.

Try 0,0,0,0

Is the frame originally set at 0,0,1,0?

yes the original position of the frame is set at 0,0,1,0. the frame is not updating it’s position