When using the inputEvent on CollisionObject3D, for example, the callback alway returns an InputEvent instance instead of the correct subclass. In the example code the if in mouse_input_event will never pass.
Example code:
class SomeNode: Node3D {
@SceneTree(path: "CollisionObject3D")
var nodeArea: CollisionObject3D?
public override func _ready() {
nodeArea?.inputEvent.connect(mouse_input_event)
}
func mouse_input_event(camera: Node, event: InputEvent, eventPosition: Vector3, normal: Vector3, _shape_idx: Int64) {
if event is InputEventMouse {
print("InputEventMouse") // Will never print
}
}
}
Fixes #535
When using the inputEvent on CollisionObject3D, for example, the callback alway returns an InputEvent instance instead of the correct subclass. In the example code the if in mouse_input_event will never pass.
Example code:
The original output would be
Now it will be this if the type has a subclass