Gamepad-Friendly UMG ~ Control Cursor with Gamepad Analog Stick! Easily Click Buttons!

Any luck with yours in 21.1 UMG?

I wonder if I can add a true false variable to the code then control that in blue prints to be able to switch thumbsticks as an option.

I hope that update is for 4.20 also will test and post back

Ok everything on the UMG end works as intended. My inquiry is more unique to my game. Iā€™m trying to map other gamepad buttons like the d-pad when Iā€™m able to also use the UMG thumbstick. It seems as though when the cursor is active all other buttons are disabled.

Iā€™m not sure where I should add the other thumbstick event input and buttons into the plug in code. Itā€™s been a while since Iā€™ve been in code. Can someone please point me in the right direction?

Iā€™m guessing in here, but I have not seems anything explicitly calling out ā€œgamepad Right thumb stickā€ maybe ā€œFGameAnalogCursorā€ is left thumb stick?

Thanks.

I need to know why when the Cursor is on screen the bottom gamepad face bottom becomes interact

using updated plugin there is no reference to this input in the plugins source?

Right I couldnā€™t find where a ā€œAā€ button was being called from or assigned either. Also somewhere in the plugin it over rules any button inputs assigned in blueprints during cursor enabled.

[USER=ā€œ2522ā€]Nick Darnell[/USER]

There is no reference in the blueprint either as far as I can see this seems to be on the engine level with software cursor I think

Itā€™s like the ā€œGamepad bottom face buttonā€ (A button) gets reassigned forced to be Primary input regardless of what you set it to or not.

Requesting a updated version of this amazing plugin, 4.23 just came out so figured Iā€™d put in a formal request for a packaged updated version. Thankjs guys.

I have 4.22 and 4.23 versions (and a tutorial for how to use it) on my website (LINK).

Awesome work SB1985 <3 Thank you for the updated version. Also, would you possibly be able to share/github your Visual Studio project so we can help keep this awesome plugin updated in the future? Thanks :3

Thank you SB1985 :slight_smile:

Hey, thanks! I used the link from page 1 and compiled it on those engine versions, there isnā€™t any difference inside the code itself, other than the engine version stuff. Turns out no other changes were required and it did not give any compile errors of any kind. Once I made sure it works properly in test projects I uploaded the compiled versions.

No problem!

Iā€™m trying to build my game, but itā€™s giving this error:

I tried adding the line in but i canā€™t seem to get it working ^^. Any ideas? Thanks <3

Did anyone ever find out where you can change the thumb sticks and face buttons?

Thanks.

Make sure you complete step #2 on tutorial, I had the same problem and this fixed it!
https://sb1985.com/other-2/gameplay/how-to-move-the-mouse-cursor-using-the-gamepad/

nope this community is pretty terrible no one helps anyone I regret leaving unity

In case somebody needs it, I ported it over to 4.24, same link as before

Thank you @SB1985 !

For those looking at how to change which analogue stick the input is taken from, in GameAnalogCursor.cpp line 136ā€¦


//grab the cursor acceleration
const FVector2D AccelFromAnalogStick = GetAnalogCursorAccelerationValue(GetAnalogValues(), DPIScale);

GetAnalogValues() is the function which gets the stick input, and it can take an argument which is the stick to read, EAnalogStick. It defaults to EAnalogStick::Left, and Iā€™m guessing because its such a common use case this code doesnā€™t worry about the possibility of changing that. I needed to, and I see a few of you do too, so if you add an argument in here you can change the line to use a different stickā€¦


//grab the cursor acceleration
const FVector2D AccelFromAnalogStick = GetAnalogCursorAccelerationValue(GetAnalogValues(**EAnalogStick::Right**), DPIScale);

You can expose this as a new setting to the editor, but it requires a bit of workaround. This is because EAnalogStick is not a UENUM, which means it canā€™t be used on a UPROPERTY. However, I worked around this by creating a new UENUM in GamepadCursorSettings.h (I called mine EGamepadAnalogStick), which has the same members ā€œLeftā€, ā€œRightā€, ā€œMaxā€. You can then make a UPROPERTY based on EGamepadAnalogStick (or whatever you call yours), which allows that value to be changed in the editor along with the others. Now you can create a new inline function to return EAnalogStick, and have that function work out which of the EAnalogStick values is the same as your EGamepadAnalogStick values. Finally, call that function as the argument for GetAnalogValues and youā€™ve got yourself a new editor setting for the stick! :slight_smile:

Itā€™s nice to see this plugin updated with the new versions of UE4. :slight_smile:

I have one concern tho : Where is gone the HappyCursor ? I installed the plugin through SB 1985ā€™s tutorial and I canā€™t find any content related to the cursorā€™s visual any longer. (Edit : Oops ! Iā€™m clumsy. The updates do not come with all the Pluginā€™s contentā€¦ maybe it should in the future ?)

I have another question yet : How do you override the Software Cursor for different menus in their Blueprints ? I canā€™t access Software Cursor from here.

And another one in fact : The plugin works when I play my Level for the first time after lauching UE4, but if I play a second time, the stick do not move the cursor anymore. Why is it ?

Lastly, how do you make the actual mouse use the Pluginā€™s virtual cursorā€™s acceleration and stuff ?

You have to use the disable virtual cursor function from the player controller, basically turn it off when you want movement back on the player