Cast GuiBase2d To Multiple LayerCollectors (ScreenGuis)

Given a single Frame stored in a Script, is it possible to cast it to multiple LayerCollectors (SurfaceGuis & ScreenGuis) so all LayerCollectors display the exact same Frame?

Instances can only have one parent and therefore a Frame cannot be displayed on two LayerCollectors at the same time. I am looking for a (hacky if necessary) solution to this problem.

In case you don’t know what a LayerCollector is:
https://developer.roblox.com/en-us/api-reference/class/LayerCollector

1 Like

take a look at viewport frames, you can use them like security cameras allowing a live feed from the viewport frame to a surface GUI.ViewportFrames tutorial in Roblox! - YouTube
ViewportFrame GUI

I thought about that, but I still want to pass mouse input and have the GUI react to mouse hovers and such.

in what way do you want the GUI to react? to mouse hovers

Let’s assume we have a Frame with a TextButton. Said Frame will be cast to Part A and ScreenGui B. I would like for the player with ScreenGui B to be able to use their mouse to fire MouseButton1Down and drag the TextButton across the Frame and have this update live anywhere the Frame is being cast to (in this case, the only other place is Part A’s SurfaceGui).

so you are trying to capture a players screen GUI and cast it to a parts Surface GUI ?

Not exactly. Another person can control the SurfaceGui (using the Adornee property) and it will update on the SurfaceGui. I’m trying to have one Frame be rendered onto two different areas without sacrificing any functionality, especially input.

have you not just tried copying position and size properties to the desired surfaces through events , so like if a person makes a change then a loop will pick up on it log down all the desired Screen GUIS their properties and positions etc and send it to the server through remote events and consequently the players you want it to display it to through client events and force them to update their screen and surface GUI’s witht the sent data

I could do that. Originally I was thinking this would be used for collaborative purposes where multiple people could edit simultaneously so I’d have to make a different controller for each separate frame to achieve this effect using that method.

if you want it to be collaboration between everyone in the server it shouldn’t be that hard

1- server script:

  • takes the screen GUI data from that player firing the event
  • compares it to a table or something that will say which players are in collaboration
  • fires the data to all those players the player is in collaboration with

1- local script per player contains:

  • the code the player uses to move GUI’s around the screen
  • every couple of seconds or quicker fire all the screen GUI data to the server to be sent to collaborators
  • accept server event to update GUI data from collaborators

additional notes:

  • you dont want to delete any GUIS if you are updating your screen
  • you want to make sure that you move the necessary GUI’s rather than creating duplicates