How would I randomize the movement of my gui

I’m currently trying to make a system where you’d make your mouse follow a circle and begin to gain a form of progression from it, but I need the gui location to be randomized, but the issue I’m seeing is that I cannot do the Random.new/Random:NextNumber in the brackets or else it’ll say
image

I’ve tried turning UDIM into a table so far, but from there I don’t really know what else to do atm.

1 Like

Why not? Can you show us your code?

-- \\ Variables // --

local Randomzier = Random.new()
Randomzier:NextNumber(0, 300)
local Meditation = Instance.new("BoolValue")

-- \\ Services // --

UIS = game:GetService("TweenService")

-- \\ Functions // --

game.StarterGui.TheMeditations.MovingCircle:TweenPosition(
	UDim2(Randomzier:NextNumber(0, 300),Randomzier:NextNumber(0, 300),Randomzier:NextNumber(0, 300),0),
	Enum.EasingDirection.Out,
	Enum.EasingStyle.Linear,
	1,
	false,
	nil
)

You make a new UDim2 with UDim2.new, and you need to tween the position of the circle in the player’s PlayerGui, not in StarterGui

1 Like

How do I make it play as a Gui tween. I have no idea how to use it.

The error attempt to call a table value means you’re calling UDim2() instead of UDim2.new().

You should also look at the UDim2 page on the developer api reference. Your 1st and 3rd arguments that you pass into your UDim2 should be between 0 and 1 (unless you want it to go off screen)

UDim2.new(Randomzier:NextNumber(0, 1), 0, Randomzier:NextNumber(0, 1), 0)
1 Like

Oh. I finally figured it out, I just need to do the other part of the script. Thank you so much for the help.