- Home /
How do I leave some GameObjects out of a build?
I'm working on a project that I'd like to be able to build to multiple platforms (Web, Android, iOS). The web version of the game makes heavy use of terrain and trees, which aren't supported by the mobile versions of Unity.
When building the mobile versions of the game, I'd like the build process to omit the terrain and the trees. (Eventually, I'd like the build process to automatically iterate through the scene and dynamically swap in certain substitute objects in their place, but I'm not up to that yet. :-) )
The naive solution to this problem is to spin off the project into a branch and just delete the terrain and the trees, but I'm looking for a solution that will allow me to publish from my original scene files to all platforms, so that if I need make any updates it's straightforward to propigate them to all versions. For similar reasons, I'd like a solution that does not modify the original scene files as part of the build process.
Is what I'm looking for possible?
Thanks in advance!
Sort of a scene equivalent of #if conditional code compilation. Good idea, but I'm not sure how. One possibility might to put as much as you can into prefabs, create platform-specific prefabs where needed, and then have a small/simple scene per platform from which you do the build. (But I haven't done much with either multiple platforms or multiple scenes, so take this with a grain of salt.)
That's really interesting. It sounds pretty tedious, but at least it would work, if nobody comes up with an easier answer. Thanks!
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Mobile Terrain in AssetBundles on IOS and Android 1 Answer
Things/features not available on android 0 Answers
testing ios build on device 3 Answers
SDK Build Tools version 23.0.3 < 25.0.0. 2 Answers