Sprite inside game object inside game object file not rendered (DEF-1542)

I have a game object file with structure like the following

Then I add this game object file to a collection. The sprites is not rendered.

Then I tried the following structure

The sprite is rendered.

Is it not allowed to add game object to a game object file? Is it an intended behavior? Is it a bug?

Check z values in position, accumelated value needs to be within -1 and 1 range for them to be rendered.

As @DeManiac says, it’s most likely related to a z value being outside the range specified in your render script. The default render script has a range from -1 to 1. You can change this by copying the render script, modifying it and pointing to it in your game.project.

The other problem is I can’t manipulate the properties of the game object inside game object file. The properties are not appear.

For additional information, I can’t create a game object by right-click on the root Game Object and add game object component. I managed to get a game object here by create it on some collection, and then copy/cut it to the game object file. I set the z position to 0 before I copy/cut it.

I don’t think it related to the z position since I did not change the z position of the sprite. I just change the parent of it.

this one, sprite_ruin is not rendered


this one, sprite_ruin is rendered

No, it is not allowed to add a game object to another. There is a “Game Object” item in the components list when doing “Add Component” but that is a bug and does not result in anything. Worse is that I just discovered, like you did, that you can copy-paste a game object into another, which is pretty severe and must be fixed.

The parent-child hierarchy of game objects that you can create in collections affects the scene graph only. Read more here:

http://www.defold.com/doc/building-blocks#_collections
http://www.defold.com/doc/message-passing#_child_parent_vs_collection_object_hierarchies

Ouch, I should have read the question better. That’s a pretty severe bug for sure! Did you create a Jira ticket @sicher?

The problem is occurred on Game Object File. When under Collection, it is fine to nest game objects (not by right-click, but by drag it to other game object). Is that normal?

Another question: are there any alternative way to organize components inside Game Object File.

Yes, collections are the way to organize game object hierarchies into the scene graph.

No, components live in single game objects.

Yes, I filed a ticket.

DEF-1542