I’m trying to make simulator popups where when the player collects an item, the popup comes up and it tweens towards the other icon associated with it. The problem is, these icons are parented to different frames( and their position is set using scale), and so when I try to position the popup, it is the complete wrong place. Not only that, but the popup is suddenly disproportionately large. I’ve tried to use absolute position, but I have no idea what I’m doing. Any answers would be appreciated. My code is below:
local correspondingFrame = Left:FindFirstChild(Icon.Name) or Up:FindFirstChild(Icon.Name)
if not correspondingFrame then Icon:Destroy() return end
local ClickIcons = correspondingFrame:FindFirstChild("ClickIcons") or correspondingFrame.Frame:FindFirstChild("ClickIcons")
if not ClickIcons then Icon:Destroy() return end
local correspondingIcon: ImageLabel = ClickIcons:FindFirstChild("Icon")
if not correspondingIcon then Icon:Destroy() return end
local correspondingAbsolutePos = correspondingIcon.AbsolutePosition
local correspondingPos: UDim2 = correspondingIcon.Position
local goalPos = UDim2.new(correspondingPos.X.Scale, correspondingAbsolutePos.X, correspondingPos.Y.Scale, correspondingAbsolutePos.Y)
local originalSize = correspondingFrame.Size
Icon.Size = originalSize + UDim2.new(0.25, 0, 0.25, 0)
local tween = TweenService:Create(Icon, TweenInfo.new(0.65), {Position = goalPos})
tween:Play()
