0 votes

I have a quad in the 3d environment. Now I'd like to be able to click on that quad like it's a button. In Unity I'd attach a script and do a OnMouseDown()

What's the Godot way?

I'm new to Godot and still learning the terminology. Hard to look things up when you don't know what they're called ;)

in Engine by (12 points)

1 Answer

0 votes

The only solution I can currently think of is by putting an area in front of the player character that rotates with the look of the character. Then have code that instructs the area to run whatever code(via some function call like, [Object That Has The Code That is Needed to Run].[Function You Want to Call to Use the Code] but without the brackets. Another thing. You need to have the object as an onready var. Example: onready var object = get_node(the path to the nod you want)) if both the interact button is pressed and the button is within the area. If you want the area to be small then you could parent it directly to the camera but have it at a long offset.

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