#What alternatives are there for GetGuiObjectsAtPosition()

1 messages · Page 1 of 1 (latest)

orchid osprey
#

title

#

scripting gods help me

#

@lethal brook i apologize for ping, but could you help

smoky grove
orchid osprey
#

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

smoky grove
#

Hmm

#

well I just learned this method exists

lethal brook
#

you will probably have to do something like that

smoky grove
#

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

lethal brook
#

how does this work with rotation

smoky grove
#

then use Sort Table to Sort based in ZIndex

#

oh yeah then with Function Return you return the table

smoky grove
#

because for my explanation then you'd need math.rad

#

also cos and sin

#

actually this is interesting

#

steve wants to help right steve

lethal brook
#

first we check if the base function uses the aabb or the actual bounding box

lethal brook
#

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

lethal brook
#

alright so first we need to get the actual top left corner's position which would be the absoluteposition rotated about the object center

orchid osprey