How to turn a 3d object into a button

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mfor1967

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 :wink:

:bust_in_silhouette: Reply From: Noddy

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.