How can I add a click event to a 3D entity in FXGL?
Box box = new Box(PlotConstant.WIDTH_X, PlotConstant.DEEP_Y, PlotConstant.LENGTH_Z); box.setMaterial(material); box.setDrawMode(DrawMode.FILL); Entity entity = entityBuilder(data) .at(data.getX(), data.getY(), data.getZ()) .viewWithBBox(box) .with(new IDComponent(data.get(“name”), data.get(“id”))) .onClick(e->{ System.out.println(“click box”); }) .build(); Clicking on this box does not trigger the mouse click event. I have tried using entity.getViewComponent().addOnClickHandler and entityBuilder().onClick, but it seems that these methods do not work. java javafx fxgl […]