Hello Everyone(hope someone reads it) , I’m gonna make this tutorial short.
This is directed towards newer developers(Scripters mainly) so i will try to explain everything as good as possible
The Desired effect is something like this:
LETS BEGIN!!!
(Keep in mind, we will be using module scripts, so you need SOME understanding)
Step ONE - Creating our setup
Create a local script and a module script right inside of it (ignore the sound)
Then, Enter the module script and set up your services
Right below them, we will create a variable called “connection” with a value of nil
This should be our final setup
Now we are creating a function, that starts our follow script, later we will define one that stops it.
– On line 7, we are creating our function with two elements - the UI object and the text(optional)
– On line 9 we are making our UI element visible, just in case
– On line 13 we are defining the connection variable we set up earlier. We just made it define a function. In this case, the function is “RenderStepped” which fires every frame. This will give a smooth look to our finished product.
– On lines 14 and 15 we are getting the Mouse Location and the GUI Inset(this matters a lot for accurate positioning)
– On line 18 we are calculating the position, adjusted relative to the GUI Inset.
–On line 20, we are finally calculating the end position of the UI element and applying it.
Step Two – The closing function (The one that disables our following code)
This one is fairly simple
–On line 27 we are making our UI element invisible
– On line 29, we are disconnecting our RenderStepped function, so we don’t cause performance issues.
THIS SHOULD BE OUR FINAL RESULT
Now lets use it in an actual script.
Here’s a demo
This will make the UI follow our mouse for 5 seconds and then stop, disappearing.
Hope u liked it guys, and please leave a like or follow me @RobloxerAndany