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
 

Correct UDim2 for if statement?

Previous Thread :: Next Thread 
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
07 Aug 2015 09:11 PM
for _, v in pairs(child) do
if v.Position > UDim2(0,0,0,1155) then
v:Destroy()
end
end

how would I change the UDim2 so it is in the correct format to compare to v's position?
Report Abuse
Voidacity is not online. Voidacity
Joined: 05 Nov 2009
Total Posts: 15759
07 Aug 2015 09:16 PM
`v` is a gui object right? If that's the case, then you can use AbsolutePosition.


Depends on what you're trying to compare. The X or the Y axis, or both.

if (v.AbsolutePosition.X > 1155) then
-- v's X position is more than 1155
end
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
07 Aug 2015 09:25 PM
absolute position wont work right with a scrolling frame... :(
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
07 Aug 2015 09:28 PM
then do

v.Position.X.Offst > 1155
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
07 Aug 2015 09:32 PM
Ahhh thanks. Saved me a lot of trouble. BTW though, its Y, not X.
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