Godot Version
v4.3.stable.official [77dcf97d8]
(MacOS)
Question
I am trying to place multiple clickable Control Buttons in a 3D space — How can I do this? This seems relativley simple but I’m unable to figure it out. Any help would be appreciated.
Here is what I have right now:
I created a MeshInstance3D and set the mesh to a QuadMesh. The material overide is a local-to-scene StandardMaterial3D, with a ViewportTexture set to the SubViewport. This renders it in the scene, but it does not provide interactivity.
Local script under button 1:
extends Button
func _ready() -> void:
pressed.connect(func():
print("CLICK")
)
Console
Not getting the “CLICK” message. No obviously-solved errors, but there’s these weird ones which seem relevant:
Other Attempts
I thought about using a static body and detecting clicks (as suggested here), but that wouldn’t allow for multiple buttons. So I thought I could to convert the input_event’s click_position to a relative Vector2(0-1, 0-1), which worked, but I wasn’t sure how to convert that into the actual button inside the viewport. This method also seems bad because I would have to manually program more functionality later on (like mouse hovers).
I tried using a Sprite3D, but also got no interaction.