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
 

gui collision

Previous Thread :: Next Thread 
Iplaydev is online. Iplaydev
Joined: 19 Dec 2011
Total Posts: 292
16 Apr 2016 10:55 AM
gui collision. why can't it be easier?

snort
Report Abuse
Notwal is not online. Notwal
Joined: 31 Dec 2014
Total Posts: 915
16 Apr 2016 11:02 AM
Ikr, the wiki has a script for it, but it's rather painful to look at.



Of course I talk to myself. Sometimes I just need expert advise.
Report Abuse
cpmoderator12345 is not online. cpmoderator12345
Joined: 26 Jan 2013
Total Posts: 15651
16 Apr 2016 11:37 AM
roblox was dumb
for now you will have to pythagorus


Report Abuse
Threatboy101 is not online. Threatboy101
Joined: 27 Oct 2012
Total Posts: 874
16 Apr 2016 12:16 PM
Actually since the time i've fixed the over complexity in Moose's code he changed the code on the Wiki since he wrote it. Here is the link to the forum.

https://forum.roblox.com/Forum/ShowPost.aspx?PostID=187243626

but the only line of code you need is

function isTouching(gui1, gui2)
local g1p, g1s = gui1.AbsolutePosition, gui1.AbsoluteSize
local g2p, g2s = gui2.AbsolutePosition, gui2.AbsoluteSize
return ((g1p.x < g2p.x + g2s.x and g1p.x + g1s.x > g2p.x) and (g1p.y < g2p.y + g2s.y and g1p.y + g1s.y > g2p.y))
end
Report Abuse
LateralLace is not online. LateralLace
Joined: 19 Sep 2015
Total Posts: 662
16 Apr 2016 12:18 PM
And you forgot to take in to account ROTATION, since those can collide over other gui too.
Report Abuse
Threatboy101 is not online. Threatboy101
Joined: 27 Oct 2012
Total Posts: 874
16 Apr 2016 12:21 PM
Well I have not tested for rotation but I have a hypothesis that this will still work.
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
16 Apr 2016 12:23 PM
Zindex and Scale are your best friends.


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