Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CreateModel character spawn delay & memory leak #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

royal0959
Copy link
Contributor

@royal0959 royal0959 commented Apr 8, 2023

modelPool did not function as a player's model pool is removed each time DestroyModel is ran. this made the function reapply the same humanoid description each respawn, delaying respawning client-side for up to a second due to GetHumanoidDescriptionFromUserId & ApplyDescription - this delay is especially notable when a player's visiblity callback (CanPlayerSee) changes, in which case it will cause a very noticeable delay when the player model needs to be spawned in again

additionally, while modelPool is removed its model parented in lighting is never destroyed and a new model would continue to be created on each client each time a player respawns and are never cleared until the client rejoins

I had made it so the cached model updates its humanoid description after each respawn to still sync with player's roblox avatar, although it now takes 2 respawns to load in a new avatar rather than 1 respawn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant