Go has no +Add Component option

I am using Defold 1.4.1 release on Ubuntu.
I have loaded the Walking astronaut tutorial.
Without any changes, if I open the main.collection, and right click on the astronaut go in the Outline view, the menu which appears does not contain an +Add component option (or +Add component file). I tried deleting the sprite and script to see if either component option would appear, to no avail.
If I add a new Collection and go, and right click on this go then both +Add component, and +Add component file, appear in the drop down list.

Please can some one explain this.

Edit: I think I have worked out what is Occurring. If the go is contained in a separate file to the collection then it needs to be explicitly opened in the outline window to be able to add a component to it.
It would be good if the editor could allude to this in some way:-)

To edit the game object in this case, you need to open the game object file.

Correct, in these cases the representation of the go you see in the collection is a reference.

When anything is referenced from outside the collection, its textual representation in the outline is italicized. In the attached screengrab, camera_target is a ‘real’ gameobject while both the gameobject camera and the script component attached to camera_target are references. Blue dropdown arrows represent when a user property visible from the editor is modified from its defined default value.


1 Like

Thanks, I see the italics now you have pointed them out.
I don’t quite understand the Blue; ‘Modified by its defined default value’, I was going to ask what this means :D, but err I think I get that, I tried to get something to turn Blue by modification, it sounds like it is very simple, but did not succeed, so maybe I don’t know the context, please can you give an example.

In a script component, using go.property() you can create properties that are exposed to the editor which you can edit in the Properties pane below the Outline.

The default value is thus defined in your code when creating the property this way. The blue UI elements appear when the value does not match this default, and the editor also provides a button that reverts the value to the default you’ve defined.

This allows you to set these properties dynamically within the editor for configuration, or creating references or collections with varying initial values of the same properties within your script. This is the Outline view of my project using Orthographic Camera showing the modified values in the Properties pane.