0 votes

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.

in Engine by (12 points)

2 Answers

0 votes

I ended up solving this by setting the sprite to invisible in the _ready function, like this:

func _ready():
    $Sprite.visible = false
by (14 points)
0 votes

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.

by (61 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.