|
| 09 Apr 2015 08:31 PM |
| I know how to make key functions, I just don't know how to make a gui move with WASD |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 09 Apr 2015 08:32 PM |
UserInputService
check if the input is the W, A, S, or D keys
move GUI accordingly |
|
|
| Report Abuse |
|
|
|
| 09 Apr 2015 08:32 PM |
Once you have the key, check when it's pressed, and if it's pressed, add numbers to the curren UDim2 according to what direction they are pressing.
-The [Guy] |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 09 Apr 2015 08:33 PM |
"move guy accordingly"
>implies he knows how to move the gui |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 09 Apr 2015 08:37 PM |
Well the Position and size of gui's is set with UDim2
which consists of (Xscale, Xoffset, Yscale, Yoffset)
scale is a ratio of the screen size, 0 being the top/left, 1 being bottom/right offset is just plain pixels
similar to Vectors, you make a UDim as follows UDim2.new(xs, xo, ys, yo)
To move a gui down 5 pixels, you could do the following
gui.Position = gui.Posiiton + UDim2.new(0, 0, 0, 5) -- you can add UDim2's |
|
|
| Report Abuse |
|
|