Can only move when button pressed?

  • Ensure you’re capturing the mouse cursor on launch [Project SettingsInputViewport Properties]:

  • The last node in you image sets the mode to UI only, meaning that the controller will be unable to process input; it also unlocks the mouse, meaning that the cursor can easily leave the viewport causing it to lose focus. Try it without this node, especially that you’re not feeding it any widgets at the moment.

edit: just saw the second image

Not really sure what you’re trying to accomplish. According to your Begin Play, you show a widget first and then set the mode to UI only. Once the widget is closed, you should be able to move again. Is it not working as intended?

I have set up movement inputs that only seem to work when I press a button. I want to be able to move around the scene as soon as I press play. It seems as if the movement is locked until I press the button?

alt text

Hi everynone, thanks for the reply. I have ensured that I am capturing the mouse cursor on launch. I just want the movement inputs to always be unlocked. At the moment for me to do so I have to press a button. When I go into play mode I can’t zoom in/out until I press the button. I want to be able to move around as soon as I go into play mode.

You can force in the Player Controller like so:

This will ensure that the PC gets keyboard control but will also enable you to interact with any spawned widgets.

How do you get the target to be player controller? Mine just says “target”.

Do note this is Set Input Mode Game Only node. I believe it has always looked like this but don’t quote me on that. I’m on 4.19 but that should not matter, really.

I am using 4.18 and it looks like the photo attached.

I have set up the movement inputs. Its just a case of finding out how to activate movement inputs when in play mode.

Looks fine to me, Epic probably made it consistent. Just make sure the self is the actual controller; as in, do in the the Player Controller.

I have tried this and still no luck in solving the issue.

I got it to work flawlessly with the above-mentioned method. As soon as you hit Play, the new viewport has focus and both keyboard and mouse are responsive and need no initial click.

Put some prints string nodes in you controls to ensure they’re actually firing.
Remember to enable touch events in the controller.

How do I enable touch events in the controller?

How did you even write all that code without checking whether anything works. Here’s the input:

I have done this and still no luck. There must be something missing.

Looks like there isn’t a solution to the problem. I suppose it was worth a punt.

Is your GameMode set up and the Player Controller, too? I’m assuming that the code you’ve shown sits in the PC but did you assign it in the Game Mode?

I have set up the Game Mode and assigned the PC in the Game Mode.

And your custom Game Mode is selected as default?

Somehow I feel I lost you somewhere on the way. In your original post you said that you can move just fine. It’s just the initial click you were having problems with…

My custom Game Mode is selected as default. Just to clarify what I am trying to achieve. Movement inputs have been setup that only seem to work when I press the hide_ui button that’s been setup. I don’t want this to happen. What I actually want is the movement inputs to be activated when I press play.

The movement inputs should than remain activated.