Do disabled components get built?

Hello all

I’ve been making my game with probuilder, in order to see them in the editor I’ve used this mesh renderer.

If the mesh renderer is disabled, will Unity build that into the final game?

Should I remove this mesh renderer from the prefab? It’ll basically affect every level in the game.

Thanks for the help
8802643--1197037--upload_2023-2-13_11-3-15.png

I would expect so, yes – Unity would have a very hard time proving that you never try to turn the component back on at runtime!

Yeah, but so what? The performance impact will be infinitesimal. You should probably just leave it on in case you need to adjust the mesh later.

Nah, don’t bother. If you want to double-triple make sure those particular Renderers get turned off at runtime, just make a little script that GetComponent()s for them and sets them not enabled and put that script on each of these objects. Or Destroy()s the MeshRenderer in Start(). Either way it is unlikely to amount to a hill of beans memory or performance wise.

Ok got it. Thanks for the confirmation everyone.

I’ll leave the mesh renderers disabled just in case I need to make adjustments to the prefab later down the road.