I cannot move up a gui object of a frame

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I need to create a notification system where if it already detects a existing notification, position the notification up by a bit to allow the player to see the new one they just received.

  2. What is the issue? I don’t know how to move it up and it won’t.

  3. What solutions have you tried so far? I have tried already and different methods but its so hard because I don’t receive a error message in the console.

All I want to do is a for i,v in pairs to see if there is any existing notifications in the gui and if there is, move their current Y.Scale. Ehh anyways here’s my code.

local function createNotif(info)
	for i,v in pairs(game.Players.LocalPlayer.PlayerGui.NotificationGui:GetChildren()) do
		if v.Name == "NotifTemp" then
			v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, v.Position.Y.Scale + .3, v.Position.Y.Offset)
		end
	end
	
	local Notif = NotificationTemplate:Clone()
	Notif.Parent = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NotificationGui")
	Notif.TextLabel.Text = "Cannot enter database, we detected suspicious activity from "..info.."."
	Notif:TweenPosition(UDim2.new(1, 0, 0.9, 0),"Out","Quint",.5)
	wait(10)
	Notif:TweenPosition(UDim2.new(2, 0, 0.9, 0),"In","Quint",.5)
	wait(1)
	Notif:Destroy()
end

I already have the functions and everything setup, I just want to learn how to move it up.

If you don’t mind the UI not tweening up, then you can take a look at UIListLayout | Roblox Creator Documentation, which can take care of vertical placement for you. (You might have to also change the LayoutOrder.)

If you want to do it purely code-based, take a look at this piece of your code:

This actually moves the object down, try changing it to -0.3 to see what happens :smile:

yeah i was thinking the same thing, but then it just ruined the whole tweening animation idea which i did try

You could try something like this:

if NotifGui:FindFirstChild(UINameHere) then
   -- move it up
   Notif.Position.Y -= UDim2.new(0, 0, 0.1, 0) -- increase or decrease 0.1
end

Sorry I updated my code changed it into a negative like you said, and i changed the value higher so I can see a difference but here’s what happens

https://gyazo.com/6cc9d2ae9ad56fb93e372c5dde4f18de

this is probably because 0.3 would be around a third of the screen (because it’s scale). Try changing it to a little above the Y scale for the notification label’s size.

how would i do that exactly? Because i am using the scale? or do you mean use the offset?

I mean to get the size of the textlabel, (assuming you are using scale.) then adjust the position of the old one. something like this:

local function createNotif(info)
	for i,v in pairs(game.Players.LocalPlayer.PlayerGui.NotificationGui:GetChildren()) do
		if v.Name == "NotifTemp" then
			v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, v.Position.Y.Scale + v.Size.Y.Scale + .05, v.Position.Y.Offset)
			--add the size to the position scale, then add some more so it goes just above the other. (i did it for you btw.)
		end
	end
	
	local Notif = NotificationTemplate:Clone()
	Notif.Parent = game.Players.LocalPlayer.PlayerGui:FindFirstChild("NotificationGui")
	Notif.TextLabel.Text = "Cannot enter database, we detected suspicious activity from "..info.."."
	Notif:TweenPosition(UDim2.new(1, 0, 0.9, 0),"Out","Quint",.5)
	wait(10)
	Notif:TweenPosition(UDim2.new(2, 0, 0.9, 0),"In","Quint",.5)
	wait(1)
	Notif:Destroy()
end