Saturday, July 30, 2022
HomeGame Development3d - Methods to make a collision object inside a viewport detect...

3d – Methods to make a collision object inside a viewport detect mouse inputs?


I’m engaged on a 2D recreation with a spatial node (a 3d node) inside a viewport.
Nodes throughout the viewport ought to be capable of detect consumer enter from what I can discover on-line, however for some purpose it does not appear to work for me.

My tree holds the viewport in a viewportcontainer. The node throughout the viewport handles the consequences of detection. In a standalone scene, the node detects mouse inputs with none issues.

Order of nodes within the viewportcontainer

The code of the spatial script:

extends Spatial

func _on_Area_input_event(digicam, occasion, place, regular, shape_idx):
    if (occasion is InputEventMouseButton):
        print(get_parent().identify)

Moreover, I made positive that:

  • Deal with Enter Domestically throughout the viewport is true
  • Disable Enter in Gui throughout the viewport is false
  • Object Choosing within the viewport is false
  • The viewport container is just not blocked by another nodes
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments