The issue is that i need to hold pressed the mouse button to drag the camera, I just want to drag the mouse without any button pressed, there is a way to do that ?
Judging by the script you do not need to hold the button. This should work as is. You also do not need to cast in this case. It will work without it.
You may have a problem with capturing the initial click, though. Can you try clicking in the viewport once after running the game. Once you’ve clicked you should still be able to move the camera without holding the button.
That’s not how casting works and you do not need the cast here, trust me. Saves you a bit of performance. But that’s not the issue.
Although, one thing that could make it stop working is the actual cast, if it fails, the input does not get processed. Consider some ghetto debugging, put a Print String node after the cast fail and see if it ever triggers.
I replicated this in a blank, clean project and I do not need to hold the button to make it work. The issue is elsewhere then.
Anything else that you want to share?
you’re switching controllers?
you have an UI that might consume input?
widgets pass Handled / Unhandled?
anything else is using the same InputAxis in another blueprint?