Hello! I’m using a viewportframe to render a map. Its not supposed to render certain models mind you, just the workspace so think of it like google maps in a way. I’m trying to make it for a ATAK system, anyway I need to find a solution to fix this simple yet challenging problem; removing lag. ITS SUPER laggy and I couldn’t find a way to fix it so here you go.
Tried looking in developer hub for solutions, however, no luck!
I could be wrong, but I think iterating over the entire workspace plus cloning its Children every single frame is quite expensive.
Also I dont quite understand why you return in the for loop on line 15 as this will stop your function an therefore you will need mulitiple calls to Mapper to eventually fill your returnedParts table with all descendants of workspace.
If your requirements allow it, what about going through the workspace once (by removing the return statement in Mapper and parenting all parts in returnedParts to frame) and only updating the camera’s CFrame every frame?