Help with tweenposition

I made a notification script but it seems to disappear to quickly

Script: (modulescript)

local notifscript = {}


local gui = script.Parent.Parent
local frame = gui.main

function notifscript.notify(msg)
	frame.e.Text = msg
	frame.Visible = true
	frame:TweenPosition(
		UDim2.new(0.713, 0, 0.795 ,0),
		"In",
		"Sine",
		3,
		false
	)
	print("opened")
	wait(3)
	print("close")
	frame:TweenPosition(
		UDim2.new(0.713, 0, 1000 ,0),
		"In",
		"Sine",
		3,
		false
	)
	wait(3)
	frame.e.Text = "certified lego haxer B)"
end

return notifscript

What it happened:

UDim2.new(0.713, 0, 1000 ,0)

This places the frame 1000 “screens” downwards. So the frame has to travel so much in that 3 seconds, that you don’t see it, because it has to move so fast. I suggest you only move it down by a few pixels, so it’s smoother and more responsive

or maybe I should try to change it to 5?

You should change it to the smallest number possible, like 1.25 (just make sure it disappears completely).
If you want the message to stay on the screen for longer, try changing the wait(3) to a bigger number. The tween’s duration is 3 seconds, and if you wait 3 seconds after starting it, the second tween will start exactly when the first ends. If you wait 5 seconds after the first tween, the frame will stay there for 2 seconds before disappearing.

1 Like

I made the tween duration 3 second is for debugging purpose. I have tried 1.5 and it worked lol. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.