0 votes

Hello! I'm starting to wrap my head around Area2d and it seems to be the perfect type of collision detection for my game. However, I'm running into a weird issue. Before export, the output of getoverlappingbodies when touching a wall is always [TileMap:680]. However, after export, the value changes and it breaks my script. Three questions:

  1. Why is this happening?
  2. Is there a way to force consistent output before and after export?
  3. Is there a way to detect an object's group name with Area2d?
in Engine by (74 points)

1 Answer

0 votes
Best answer

I never really got an answer to my first 2 questions, there doesn't seem to be a good reason for changing the object references after export... However, I was able to do what I wanted with print(area.get_name()), which allowed me to identify objects uniquely if I rename all the Area2D's. They should really add a signals section to the official game documentation, it's not obvious how it works until you start getting your hands dirty.

by (74 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.