#What alternatives are there for GetGuiObjectsAtPosition()
1 messages · Page 1 of 1 (latest)
You can always recreate it with a function
yes, but i have no idea on how to script that
probably get descendants of player gui and check if their guistate is pressed?
not entirely sure
you will probably have to do something like that
but based on what it does (filters Gui elements with Visible to false, sorts by ZIndex and returns an array) I'd create a empty table, filter Gui elements & have a function with 3 parameters: gui, x, y. then you gotta compare with AbsolutePosition and AbsoluteSize (something like x >= pos.X and x <= pos.X + size.X, apply this for the Y too), then insert into the empty table the Gui elements
how does this work with rotation
then use Sort Table to Sort based in ZIndex
oh yeah then with Function Return you return the table
my explanation or the method
because for my explanation then you'd need math.rad
also cos and sin
actually this is interesting
steve wants to help right steve
first we check if the base function uses the aabb or the actual bounding box
trying the function out in studio the function does use the true bounding box affected by rotation
in order to check if a position is inside a guiobject with rotation we have to perform a change of basis transformation
alright so first we need to get the actual top left corner's position which would be the absoluteposition rotated about the object center
oh god not the trigonometry