I have a mob that, when it dies, spawns smaller versions of itself. When this happens there's a huge resource spike. The profiler narrowed it down to baking the meshes of the new objects. I have a couple of smaller questions related to this, but the crux of the issue is that it looks like the baking is occurring twice (doubling CPU usage) as shown below in both Instantiate and Transform.SetParent. I'd normally say it's redundant, but in every way it looks like it's happening twice and take over one full second total. Why would this happen twice on the same set of object (there are a variable number of spawned mobs, so the actual numbers can vary)?

As an aside, can this be backed in the prefab somehow to avoid this?

enter image description here

Possible solution:

Currently, I've set the isConvex bool to false, which has resolved the immediate situation. I'm not sure if this will impact anything else - with RigidBody attached to each mob, it doesn't appear to cause issues with collision, and so far it doesn't seem to cause any major issues with the mesh during animations, but this will need to be evaluated further.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.