Since the free release of UE4 I’ve been playing around with the engine. Amazing stuff!
Anyway, to the point. I’m working on an on-rails shooter as a teaching example, and I’ve run into a snag. The desired behavior is that the analog stick maps directly to a crosshair on the screen. I was initially surprised to find out that the analog sticks on the gamepad have a constant radius, thus the corner position (top right) isn’t (1,1), but actually (0.7…,0.7…). I guess I shouldn’t be entirely surprised now that I think about it, since they’re, in fact, analog inputs. Anyhow, I need to convert the position of the sticks in the circle to an onscreen coordinate like so:
So I started working on the trigonometry to convert the analog position to on-screen position in its own blueprint, but before I go any further I was wondering if maybe there’s an easy way to do this, or maybe there’s some method that I’m not aware of that can do this already in an efficient manner. Since I’ll be running this conversion on every tick, I don’t want it to be taxing.
Any thoughts would be appreciated.