generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I be able to move a gui using WASD keys?

Previous Thread :: Next Thread 
PurpleTerror is not online. PurpleTerror
Joined: 05 Oct 2010
Total Posts: 7368
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 is not online. 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
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
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 is not online. 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 is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
09 Apr 2015 08:34 PM
gui*, lol
Report Abuse
jewelycat is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image