Here’s the breakdown: I want to a cursor I can move with my gamepad. I tried to control the mouse position with the controller and got nowhere. Below is my progress, or lack thereof. In “event begin play” I’ve created the widget. I add it to the viewport and try to make the controller work with it here.
The set position is only called when the cursor is spawned (according to the function names)
Placing it on the Event Tick might work for what I think you’re trying to do
The thumbstick value, does it return -1 to 1? If so, multiplying the position might not be what you want to do.
An addition multiplied by the thumbstick may work better.
Also, you can try SetRenderTranslation to see if that will work at runtime instead?
Edit: I have confirmed that SetRenderTranslation works, where SetPosition does not
I believe you are right about the thumbstick. I switched to addition, and tried the render trans, but still no luck. I also set the location initially so it would have a location to move from.
Try using Debug Draw String on your Get Gamepad Right Thumbstick values, they maybe too small (multiply them by a ‘speed’ value and by Delta Time from Elapsed Time).
GetPosition would also probably never change, you’ll want to use get transform and break out the translation.
I believe I tried that (starting to get a little beyond my understanding). Here’s the results (which didn’t work). As a point of consideration I am doing this in the character blueprint. I also tried it in the widget blueprint but that didn’t work either. Although that could just be because I set it up poorly. I don’t have time now, but I will have to look up how to use the debugdrawstring, haven’t used that before.
Right, so made some big progress. Its still to working how I want it to, but I can move the widget with the gamepad thumbstick now. WOOT! I pulled in the axis values directly from the input event, multiplied by 20000 (cursor speed) and it kinda works now. And yea its pulling from event tick. Its super jerky, seems to have a boundary (like it won’t let me push the widget past a certain point), and automatically jumps back to its original location as soon as I release the thumbstick. Here’s a link to a video of what it looks like, and below is the current blueprint.
My money is on ‘Get Position’, I’ll wager it doesn’t change but you’d probably want it to.
If you change it to GetRenderTransform:Translation and lower the 2000, I think it might work
My to do list from here:
1 - Removing any camera rotation while I am in this menu and moving the cursor around
2 - Being able to tell that its in the circle so I can use it to charge up the box and spawn a particle system
3 - Setting custom boundaries to contain the widget
4 - applying random force to the widget to make it hard to stay in the circle
5 - figuring out a way to “click” with it so I can use this same system for my menu.
I won’t have time to work on that till this evening though. I’ll post any more problems I run into though.
As far as being able to tell if its in the circle, I made a collision sphere that is set in the circle and I’m guessing some sort of line trace from the widget to detect collision?
So far this isn’t working. Haven’t had time to piddle long though.