Topic was automatically imported from the old Question2Answer platform.
Asked By
LaserPanzerWal
I hope I didn’t miss an answer to this anywhere here as i couldn’t find one.
I want to be able to display a sprite for objects that are not supposed to be visible in the game, think of spawn points and similar. I do want them to be visible in the editor though so i can see them while building maps. I also want to be able to select them by clicking.
Right now I display them by using immediate geometry and while it does help, it has a few drawbacks as they are not clickable and I need to create distinctive shapes instead of using sprites.
The behavior I am looking for does exist in the engine, as for example lights are a good example of what I want for my objects.
Does anyone know how to achieve this?.
Thanks in advance.
I needed something similar for spawn points in my level and was able to solve this with the following:
func _ready():
hide()
It’s very similar to @Vysk’s solution but doesn’t require you to find any particular child node.
Not exactly what I was looking for, but I ended up with a similar solution.
I suppose while this functionality does exist within the editor, it is limited to built-in classes.
Using @Skelteon’s solution in combination with grouping nodes, you can create a system somewhat similar to Unity’s inspector icons:
Grouping nodes allows you to click on the children objects and select the parent node. Group nodes with the group node button:
or pressing CTRL+G with the nodes selected.
I used a purple ColorRect as a child of my Node2D. I can easily click the purple rect to select the Node2D and move it as needed.