Jump to content

Recommended Posts

Posted

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.

Posted

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.

Let's build cool stuff and have fun. :)

Posted

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.

Posted

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.

Let's build cool stuff and have fun. :)

Posted

If i load them in code in the Start() function, they dont do anything but sit out there? Thanks.

 

Nope.. it went right for my jugular. :P

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.

×
×
  • Create New...