Gameobject identifier

Hi.

I think I might have found a bug (or not). Either way it’s something that I don’t get it and I need some help understand how this is treated in Defold.

I’m trying to group up gameobjects in a gameobject container. So I have an hierarchy similar to this in my collection:
-go_level_1: go_left, go_center, go_right
-go_level_2: go_left, go_center, go_right

Defold is throwing this error:
ERROR:GAMEOBJECT: Unable to set identifier /go_left. Name clash?

I was expecting that the identifier should be something like go_level_1/go_left and go_level_2/go_left and no error.

Most likely I misunderstood something but I can’t figure out what.

Thanks,
Fuscy

PS: For now I’m using go_left_level_1, go_left_level_2 but it’s quite a hassle doing this for all the sub components.

I’m also profiling my game and there seem to be differences between the Web Profiler and the System one.

The System profiler shows:

  • Frame: 16.###
  • Max: 16.###

And the Web Profiler:

  • 65ms
  • Engine.Frame 64.64 1
  • VSync.Wait 58.59 1

So it’s either 15 fps or 60 fps.

When you say “game object container” you mean collection, right?

In each collection, there can only be one “go_left”. The id you assign to a game object has nothing to do with the parent-child hierarchy you’re building. Parent-child affects the scene graph only and can be changed in runtime (by sending “set_parent” messages). The id is static and never changes.

See http://www.defold.com/manuals/message-passing/

and http://www.defold.com/ref/go/#set_parent

1 Like

Oh, I think I understand now. I need to do some refactoring then.

Thanks.

2 Likes