UMG Button positioned wrong
Thought I'd save myself the trouble of trial and error and ask here of those who already know:
I have two UMG buttons, I have one positioned where I want. The other is on the opposite side of the screen, the same distance from the right edge horizontally. I am using Local to Viewport node to compare the Touch location to where these buttons are, so I can use them as virtual joysticks (the engine's built in Touch Interface does not meet my needs).
The left hand one works great, but the right hand one always gets something wrong.
I gave them both an upper-left corner anchor in the Canvas, and on Construct, I move the Right thumbstick button to be as far left of the right side as the Left thumbstick is from the left side, by taking the Left Thumbstick's X position and subtracting it from the owning player's viewport width.
For some reason, doing the math that way results in the Right thumbstick being just slightly right of center on the screen instead of mirroring the left thumbstick
What am I doing wrong?
I think I need to do another geometry-based coordinate conversion but I predict it will take me hours of trial and error (based on past experience) to figure out the magic combination since I don't understand what really happens with those nodes, and I can't access the geometry struct in a construct event.
I'll have to move the logic to a sequence with a DoOnce on the Tick or is there some other event I can use?
SO I guess that's two questions.
asked Oct 07 '18 at 06:40 PM in Using UE4
Follow this question
Once you sign in you will be able to subscribe for any updates here