At the current moment, the only way my script will activate through making the function activate only when the game acknowledges that the mouse is on the AbsolutePosition, not the actual Circle position, so I tried to figure out how to make the Anchor point the actual position of the circle, and it failed. Ending in this error.
01:24:57.516 Players.ZensStarz.PlayerGui.TheMeditations.BallRandommovement:36: invalid argument #3 (Vector2 expected, got UDim2)
So, here’s the script, and the methods I have tried vary from:
Making the Circle its own individual thing in the explorer,
Making the Circle be in its own separate GUI
Trying to change the AbsoluteSize,
and none of them worked so here I am.
Here’s the script:
-- \\ Variables // --
local Randomzier = Random.new()
local Meditation = Instance.new("BoolValue")
local GUIS = script.Parent
local Circle = GUIS.MovingCircle
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Mouse = Player:GetMouse()
-- \\ Services/Service-Related Variables // --
local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")
local MLocation = UIS:GetMouseLocation(Mouse.Hit)
-- \\ Functions // --
GUIS.IgnoreGuiInset = true
local function GetGone()
local position = UDim2.new(0,Mouse.X,0,Mouse.Y)
--print(position)
--print(Circle.Position)
--print(Circle.AbsolutePosition)
Circle.AnchorPoint = Circle.Position
if position == Circle.Position then
print("On the circle..")
repeat
script.Parent.MovingCircle:TweenPosition(
UDim2.new(Randomzier:NextNumber(0.962, 0),0 ,Randomzier:NextNumber(0.285, 0),0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
5,
false,
nil
)
until
UIS:GetMouseLocation() ~= script.Parent.MovingCircle.Position
else
end
end
RS:BindToRenderStep("GetGone", 1, GetGone)