Jump to content

hiding preloaded meshes


drarem
 Share

Recommended Posts

Maybe it's my imagination, but when i place meshes below the map for purposes of having them preloaded to help reduce lag when they spawn, it seems to help the FPS (using PF11 to view fps) when I set them to Hidden. However, finding them when they're hidden in the editor is very difficult scrolling down a huge list of scene objects. How can they be referenced without doing that if I needed to update a script or value attached to that mesh?

 

Thanks.

Link to comment
Share on other sites

When you say "spawn", do you mean your code is calling Model:Load()? Normally I would load whatever models you need at the start of the program.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Ok it's a prefab spawner, I read awhile back it might be beneficial to have the prefabs somewhere on the map for when they spawn which can create lag, and/or the initial start up lag. As Rick said, it's called precaching.

 

Prefab:Load("..")

 

Thanks.

Link to comment
Share on other sites

Yeah, for sure. That way the engine will never be loading objects as the game is running.

 

I would load a copy of the prefab in the Start function, and then duplicate that over and over when you spawn additional ones. Make sure you are creating an instance, not a copy.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...