-
What do you want to achieve? I am trying to move a GUI object inside a GUI object like this image below me
-
What is the issue? The shadow won’t move to the correct position
-
What solutions have you tried so far? I tried using the regular technique but that didn’t work because the GUI object is parented inside another gui object
This is the code I currently have
local ts = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
newclone = nil
onhoverclr = Color3.fromRGB(script.Parent.BackgroundColor3.R - 10,script.Parent.BackgroundColor3.G - 10,script.Parent.BackgroundColor3.B - 10)
defaultclr = script.Parent.BackgroundColor3
mouselocation = nil
function NewBubble()
newclone = script.Parent.Parent.Resources.Bubble:Clone()
newclone.Parent = script.Parent
mouselocation = UserInputService:GetMouseLocation()
newclone.Visible = true
newclone.Position = mouselocation
newclone:TweenSize(UDim2.new(0,500,0,500), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1, true)
for i=0.4,1,0.4 do
newclone.BackgroundTransparency = i
wait()
end
newclone:Destroy()
end
script.Parent.MouseButton1Click:Connect(function()
NewBubble()
end)
script.Parent.MouseEnter:Connect(function()
ts:Create(script.Parent, TweenInfo.new(0.5), {BackgroundColor3 = onhoverclr}):Play()
end)
script.Parent.MouseLeave:Connect(function()
ts:Create(script.Parent, TweenInfo.new(0.5), {BackgroundColor3 = defaultclr}):Play()
end)
Please do tell me if there is anything else that I should add, thanks!