The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Greetings! Good to see you all, folks.

So, I'm still starting with Game Design in general, and I've chosen to learn Godot (I've been using it for ~2 months or so now, and I'm having a blast), but I've hit a brick wall:

I'm trying to show a label whenever my character enters an area2D that is part of a specific group (Let's call it "interactable").

So:

Image01

Here is Miller, chilling in front of this knife.

IF MILLER ENTERS THIS AREA2D (that makes part of the "Interactable" group, I'd like to make a label with an "!" appear (with .show()).

Nice, a Knife

I know I could use something like:

"func _on_KnifeInteract_body_entered(body):
  >  $Player.notification.show()"

Where notification is a label (or image) with the ! symbol.

But I'd end up replicating a lot of code (for every interactable object I would end up using this, and that's not cool!)

I'm wondering on how should I approach this.
Thanks in advance!

in Engine by (12 points)

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.