I’d like to read the absolute position of backpack icons so I can properly position some UI for any device. The issue is there seems to be some security checks in place to prevent this.
The element I want to access is just called “1”, so with this code
Your guis should be in playerGui, not coreGui, unless you’re making a plug-in. Also, I’m pretty sure local scripts can’t access the core GUI so people can’t exploit by making local scripts.
You can’t index CoreGui or any of its members/children. Doing so will result in an error. I don’t think there is anything you can do except fork the backpack UI and create your own using the fork.
Best bet to get information about CoreGui content is to use Roblox Studio and Play Test.
Open Studio
File > Settings > Studio tab
Look for subsection ‘Explorer’
Show Core GUI in Explorer while Playing
Close > Restart if you prefer to
Play Test
Then you can get all the information about CoreGui that you’ll need to position things you want.
There is no way of indexing, viewing, or getting the values of anything that is inside CoreGui using a normal script or localscript as Roblox intends it to be protected. Malicious users could get the value of the ‘report game’ page’s frame position and kick/crash the user before they could even hit submit.
If you intend to attach something, best bet is to disable it from SetCoreGuiEnabled and fork your own version.
For security reasons, you cannot access the CoreGui service or even reference it. CoreGui contains many important objects essential for the Roblox Engine to function, and they dont want somebody who doesn’t know what they’re doing using it. Your own GUIs should always be placed in PlayerGui and no where else.
If you need to reference the backpack, consider making your own backpack script, Roblox has made it incredibly easy to disable parts of the default UI with StarterGui
I find not being able to read the CoreGUI elements very annoying. I don’t agree with the reasoning that simply reading those elements creates any issues. If a bad developer really wanted to use that data to block a GUI element they could do so with out it. It would be hacky and ugly but they could do it and I doubt it would matter to them what it looked like. There are very legitimate reasons for developers to want to (at min) read the details of the CoreGUI elements. For instance adding GUI elements in such a way they blend with other coreGUI elements without covering them or perhaps for adding indicator graphics for in-game tutorial based reasons. Without being able to read the coreGUI elements at runtime it makes it very difficult to implement these things while maintaining a prof look. At the very least these elements should be readable in server scripts/modules IMO.
well, maybe if developers could easily access coregui you could use it in such a way to aid malicious intent, like editing gamepass popups. or accesing events that for example, make the user chat something innapropriate, or ?? something also with the report UI. but its still a shame you cant edit it some way,