As a Roblox developer, it is currently too hard to write out full instance path names.
What I’m requesting is a simple but extremely useful feature. You know if you’re scripting UI and you have to manually write the long path to get to the specific element you want? Well this would make it much easier and faster to do that.
Basically, if you try dragging any instance from the game explorer into the script editor, it’ll paste in the instance’s full path to wherever your mouse is. Example:
This would be cumbersome since you have to drag your mouse all the way across the screen, pick up the object, and then drag it all the way back to your cursor. It would also be counter-intuitive because dragging an object implies you’re moving it – not copying a reference.
What about adding an option to the context menu? Granted, that too has its flaws. It would not be very useful on the client as it doesn’t support WaitForChild.
Yes, but while it may be an improvement, is this the best design we can draft up, or are there equivalent alternatives that are even more accessible (e.g. thread linked in my original reply)?
In the thread you linked, it suggests just copying the instance’s path. With this method it would mean less clicks overall, and it could incorporate a simple variable filler like Usering suggested in that post.
This feels like a case in which you’d be dealing with a large hierarchy, which in turn means you probably are doing something wrong or overcomplicating it.
If you are sure that the object will be there at runtime, then :FindFirstChild('name', true) might fit best for you, as it uses recursion to get the instance for you.
However, I personally do not support the idea because it’s a bit of a slimy topic with Lua and the game hierarchy constantly changing in a game. As for the client it obviously might be missing some items which won’t be there right away.
Sometimes you can get this accomplished in a much neater, shorter manner by using the ROBLOX api.
Generally you want to avoid writing out long explicit paths to objects like this.
Roblox adding a new property to an existing class (rare but can happen) or an object along the line suddenly disappearing will ruin your day with practices like this.
I would like this as a hotkey where it copies the full path to an object that you have selected, and in extension it can be a context menu item. It might be tedious to do the dragging every time, and dragging it exactly to the place you want it to be (imagine that you want it to be between brackets (), you have to drag exactly between the brackets while doing it with hotkeys might be easier).
Granted, a plugin would also be able to accomplish this.
Kind of ironic, but when you drag a .rbxm(x) file (from your desktop or windows explorer etc) to studio, it normally inserts it into workspace. If you drag it into the script editor, it just pastes the absolute path to that file, no idea why.
I used to put ObjectValues under scripts and set their values to objects I needed to reference instead of going through the hierarchy manually. In the end, replication came in and I never did that again.
I meant something like that, not hard-coded embeded references but dynamic links to objects.
Yeah but you have to remember that scripts are compiled into bytecode on the server, and then sent to the client, so they’d likely need to further modify Lua bytecode to be able to embed references, or introduce a new service for it entirely.