Where is “get_relative” in an “InputEventScreenDrag”? in c++

Godot Version



trying to find relative pos from InputEventScreenDrag event like in gdscript
but i see there is none what are the alternatives ?

void Controls::_unhandled_input(const godot::Ref<godot::InputEvent>& event)
	if (event->is_class("InputEventScreenDrag"))
		godot::Ref<godot::InputEventScreenTouch> drag_event = event;
	        drag_event. ? 

Controls extends godot::CanvasLayer
class Controls : public godot::CanvasLayer


You converted it to InputEventScreenTouch, not InputEventScreenDrag

1 Like

yes thanks ,

1 Like