I have scripted a clicking mouse tween animation for my clicker game, and my tween script works completely fine. However, whenever I run the animation, it comes up with this error in output. (Can only tween objects in the workspace.)
Here is an image of the error:
Here is my source code:
local Enabled = script.Parent.Enabled
local ClickParticle = script.Parent
local Players = game:GetService(“Players”)
while true do
wait(0.1)
if ClickParticle.Name == "ClickParticleCloned" then
Enabled.Value = true
if Enabled.Value == true then
wait(1)
ClickParticle:TweenPosition(
UDim2.new(0.465, 0, 0.836, 0),
"Out",
"Sine",
0.2,
false
)
wait(0.2)
ClickParticle:Destroy()
else
Enabled.Value = false
end
else
Enabled.Value = false
end
end
Here is a recording of the animation:
Any help with this issue will be greatly appreciated.