Hi! I’m making a 2d-specific game where the player can go back into a 3d space for a hangout/flexing.
I’ve tried to look around for some stuff, but can’t find anything better than setting character to nil, which doesn’t unload workspace.
in short,
How do I unload the character and workspace?
I know how to do player:LoadCharacter(), but I’m lost as to how to unload workspace and the character when they decide to go back to 2d (for performance). How to?
What I’ve figured out so far, as mentioned earlier, is just:
As far as I am not aware, I do not think there is a way to unload a character.
Something that would serve a similar function, though, would be to remove the character model from the workspace and then set the character to nil.
player.Character:Destroy()
player.Character = nil
This should remove the reference as well as the physical object from workspace. You should now be able to reload the character using player:LoadCharacter() fine as well.
I have unloaded the workspace from the client by adjusting the focus area for the player’s CurrentCamera instance. This does not technically completely unload the workspace, but will prevent it from rendering on the client.
Yeah, I’d say so. Thanks!
so basically just change the focus (i’m assuming moving the camera in a way that doesn’t face towards whatever you need to be unrendered?)