Nested game objects with the same name?

In my point and click framework, I have different objects in a room as game objects with a different sprite component and I use some nested game objects in there to easily position some transform points for walk_to and look_at actions. I can then have different script components to add functionality like parallax, hotspots, etc.
This way when I click on any of this for an interaction I can easily have the player walk and look at those points

The issue I have is that I have to use different names for each of these points, while I would prefer for them to be always called just lookat and walkto, but this is not allowed.

I know this is possible with collections, but it’s not really a viable options as they are really prefabs and I need to compose them depending on the needs (different sprite components, scripts, etc).

In an ideal world, the go.property for a vector3 would allow to get the initial value from positioning a point in the viewport interactively.

Is there a solution or a workaround to this?

Better extendibility of the editor! Imagine if we could draw splines or 2d meshes in the editor that could be generalized to data components in engine. Anchor components could be another way of using a data component that can attach extra transform data to their attached GO without having naming conflicts of other GOs.

Besides hoping about that, I think you would want to code your own custom scene editor for these interactions. If you’ve never made a level editor before it can be fun to figure it all out.

I was hoping to be able to avoid that. Most of the work is just object layout and Defold is already nice at that. I’m missing just a few things.
For example I have 2 editor extensions that can create a convex shape file or even a polygonal walk area from the alpha of an image.

Until the editor offers more options, I’m relying on scripting since every room already has a lua file associated with all the interaction. A simple editor extension to create the initial structure will be enough :slight_smile:

1 Like