drarem Posted June 8, 2015 Share Posted June 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 8, 2015 Share Posted June 8, 2015 Can you just make a folder for precached assets and put them in there? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 8, 2015 Share Posted June 8, 2015 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. Quote 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 More sharing options...
drarem Posted June 8, 2015 Author Share Posted June 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 8, 2015 Share Posted June 8, 2015 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. Quote 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 More sharing options...
drarem Posted June 8, 2015 Author Share Posted June 8, 2015 Thanks. Of course dragging them up the huge list to drop into the Filter will be a chore Quote Link to comment Share on other sites More sharing options...
Josh Posted June 8, 2015 Share Posted June 8, 2015 You can just load whatever prefabs you want in code: http://www.leadwerks.com/werkspace/page/api-reference/_/prefab/prefabload-r622 Quote 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 More sharing options...
drarem Posted June 8, 2015 Author Share Posted June 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 8, 2015 Share Posted June 8, 2015 If you mean some AI characters there must be some variables in the script to deactivate it that you might have to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.