Clicking Effect

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make a clicking effect that when the player clicks for a coins value it displays like a mini mouse cursor image randomly across the screen

  2. What is the issue? I can get it to spawn but only in designated positions due to me being fairly new to roblox developing. here’s a video of what i mean by click effect
    robloxapp-20231008-2036011

  3. What solutions have you tried so far? awhile ago i had found a post on this forum for this but i’ve been looking and looking and can’t seem to find it anymore no matter what i type in. as i stated before i was trying to do it myself and i was able to get them to spawn and despawn but only in designated positions.

Thanks in advance!

2 Likes

If you want a random position on the screen you could use math.random():

local x = math.random(0,100)/100
local y = math.random(0,100)/100
local position = UDim2.new(x,0,y,0)
1 Like

You can randomize the position using math.random(min, max) with each of the axes of the ui object relative to the size of the game window.

The game window size can be obtained through the camera in workspace via workspace.Camera.ViewportSize

1 Like

thank you! this was just what i needed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.