I’m attempting to make a click effect in which will start a transition on the circle, but it doesn’t seem to work as intended when I’m trying to position it, giving me an error (attempt to perform arithmetic (sub) on nil and number
). What’s the issue here?
local function createCircle(par, axisX, axisY)
local clone = script.Circle:Clone()
clone.Parent = par
local pos = UDim2.new(0, axisX - par.AbsolutePosition.X, 0, axisY - par.AbsolutePosition.Y - 36) -- error
clone.Position = pos
local tween = ts:Create(clone, TweenInfo.new(1, Enum.EasingDirection.Quart, Enum.EasingDirection.Out, 0, false, 0), {Size = UDim2.new(500, 500), ImageTransparency = 0})
coroutine.wrap(function()
tween.Completed:Wait()
clone:Destroy()
end)()
end
shop.Click.MouseButton1Click:Connect(function(x, y)
createCircle(shop.Icon, x, y)
end)