x


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!

more ▼

asked Feb 20 '11 at 05:27 PM

Yossi Horowitz gravatar image

Yossi Horowitz
1 2 3 4

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.)

Feb 20 '11 at 09:58 PM yoyo

That's really interesting. It sounds pretty tedious, but at least it would work, if nobody comes up with an easier answer. Thanks!

Feb 23 '11 at 03:54 AM Yossi Horowitz
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2609
x2013
x1521
x684
x146

asked: Feb 20 '11 at 05:27 PM

Seen: 675 times

Last Updated: Feb 20 '11 at 05:27 PM