x


Finfing objects by tag works fine in editor, not in exported/build.

I'm not sure what's going on here. I have a simple method finding objects by tag which works fine in the editor, but as soon as I get into a built game, I get 0 objects found. The objects themselves are always present. It's a very simple game with only 2 objects with the same tag name. Any ideas of what I may have flipped by mistake? I just upgraded to version 3.5.2 PRO.

Any input would be welcomed. Thanks!

more ▼

asked May 17 '12 at 05:32 PM

BugVito gravatar image

BugVito
16 1 2 4

Please provide more details and source code.

May 17 '12 at 09:42 PM Sarper Soher

More info: The game is simple, 2 objects from primitives; a cube and a cylinder. Both objects have the tag "Shape".

A method being called has the following:

GameObject[] objects = GameObject.FindGameObjectsWithTag ("Shape");
Debug.Log (objects.Length + " objects found!");

While in the editor I get "2 objects found!", with the build I get "0 objects found!".

Any ideas?

May 18 '12 at 11:49 AM BugVito

Also, Please note that I have built a plain game only containing this, and this works as it should. Which is why I am wondering what I could have done to cause the issue mentioned.

May 18 '12 at 12:22 PM BugVito

Debug's show in published builds?? I haven't tried that, that I can remember, but I wouldn't think debug would print on screen or something in the built game...

May 18 '12 at 12:54 PM Lo0NuhtiK

The debugs are logged in "output_log.txt" inside the project_Data folder.

May 18 '12 at 01:15 PM BugVito
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

This would be a great "DOH!" moment. This is a drawback from working multiple people using the asset server. The build originally included the objects described, in the main scene. As it turns out, instead of using this scene, a co-worker built a brand new scene with similar objects and did not adjust the build settings. In short, the built game was running a non functional scene, which looked exactly the same...

Big doh!

more ▼

answered May 18 '12 at 12:56 PM

BugVito gravatar image

BugVito
16 1 2 4

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x655
x2

asked: May 17 '12 at 05:32 PM

Seen: 324 times

Last Updated: May 18 '12 at 01:15 PM