This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

So, I'm making a 2D free-roam FNaF fangame, and am currently working on the navigation system. The way I intend it to work is that in every opening and interactable object has an invisible button, with it's collision shape suited to the object shape. I am trying to do this with an Area2D and a CollisionPolygon2D, since I am not using physics and a polygon lets me customise the shape.

The problem is, I don't know how to script the Area2D to respond to clicks.

TLDR; I need a way to use an Area2D as a button.

Thanks in advance!

in Engine by (12 points)

This thread seems to have covered this question nicely:

https://godotengine.org/qa/22606/how-ive-handled-area2d-mouse-click-not-question

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.