Little issue with Mouse X and Mouse Y

Hi ! I have a little issue with the Mouse X and Mouse Y node, I made this simple script to drag my camera in the game.

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 ?

PS: Sorry for my english and thank you.

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.

Is this the case?

It is not the first click, i’m casting because i’m in another graph

i’m casting because i’m in another
graph

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?

i try in a new project and it work :frowning:

Thanks for the advice on the cast, i have fixed in this way, i uncheck the “show mouse cursor” on the controller class :slight_smile:

Oh, that was quick! Well done!

i uncheck the “show mouse cursor” on
the controller class :slight_smile:

So this stopped working because the cursor wasn’t showing? Interesting, actually.

Yes, i did not expect this :slight_smile: