So ive got bar at the bottom of my game and i want it to have a button on each side and when clicked it moves the bar to that side by 20 pixels.....and im sorry if this is a noob question, but im a big noob at LUA :P, how would i go about doing this?
I have this button
1 | function die() |
2 | script.Parent.Parent.TestMovePos. --this is where i think im stuck at |
3 | end |
4 | script.Parent.MouseButton 1 Down:connect(die) |
idk but i hope its as simple as finishing that line...but im not sure.
If somone could guide me to how to do this that would be awesome :)
First off, it's "Lua", not "LUA".
Second off, here's what you need to learn.
To move the position of a gui nice and smoothly, you can learn tweening. Tweening allows you to smoothly transition Guis to the designated position. Otherwise, you can just use
1 | YourGuiNameHere.Position = YourGuiNameHere.Position + AmountYouWantToAdd |