Feedback on "WorldModel"

This is missing a pretty serious caveat regarding how WorldModels work; the expected behavior is to parent and unparent (or create and destroy) them as needed, instead of leaving them parented underneath ViewportFrames. Even a disabled ViewportFrame will still have its WorldModel step physics, resulting in some potentially awful performance issues.

I personally was affected by this; I cache ViewportFrames and the models underneath them as creating the models was too slow. I had to rearchitecture a bunch of code to unparent just the WorldModel until the ViewportFrame is visible. Pretty niche trap to fall into, and if nothing else devs should be aware that this behavior exists

Affected URL: WorldModel

4 Likes

Hi Mauio, thanks so much for the feedback! I’m sorry the lack of information gave you a hard time. I went ahead and added the following sentence to the WorldModel doc page to let devs know they should create/delete WorldModels as needed:

To avoid possible performance issues, make sure to only create WorldModels when you want to show them and to delete WorldModels that are currently not in use.

(please note it’ll take a week or so for the live doc page to be updated because of our internal process, unfortunately!)

1 Like