While this isn't a direct coding error, I'm wondering how I would go about scripting controllable GUIs (By that I mean, a little blob one could move around on screen). This is for my little project of building a retro arcade machine inside of ROBLOX. I have a reasonable amount of experience/knowledge when it comes to Lua programming. Thanks in advance :)
You can place this inside s local script inside the Gui Object you wish to move:
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 |
03 | local gui = script.Parent |
04 |
05 | local dragging |
06 | local dragInput |
07 | local dragStart |
08 | local startPos |
09 |
10 | local function update(input) |
11 | local delta = input.Position - dragStart |
12 | gui.Position = UDim 2. new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) |
13 | end |
14 |
15 | gui.InputBegan:Connect( function (input) |
Too much to explain to be honest.
Hope this helps. :)
just listen for input events.. like maybe if a key is pressed or a finger is slid on the screen, you move the GUI in a particular direction, and things like that..