Blueprint InputTouch Event includes a 3D vector which refers to the touch screen location rather than a world location, if it was changed to a 2D vector it would likely remove any possible confusion. (specially given the lack of documentation)
Still confusing to this day.
You touch the “Screen” kind of self explaining its not a 2D Vector since you most likely use it as 3D Vector anyways. Also don´t put non Bugs into the Bug Category. Feature Request a Change or a better Tooltip =)
A vector implies a world location with depth, such as a hit result. You wouldn’t use a screen result as a 3D vector because those two XY screen values don’t mean anything in relation to world position. To get a world location you have to break the vector into a 2d vector, supply that to get a hit result under that location THEN get a vector back out.
IMO this is a bug, but I didn’t create it, so don’t ask me not to do it please.
Sry the Bug part was adressed at OP.
But if you are very familiar with UE4 Vector2D is very rarely used asside from Deproject to World and widget stuff. Everything else uses V3 and its not unusal to have V3´s to have one or two components at 0 for all kinds of things. You would end up making it a V3 in most cases anyway asside a few exceptions.
But like I said I think its more intended to be V3 than a mistake. A Tooltip would be enough to make it clear. But Im fine with either one.
Edit: Or rename “Location” to “Screenspace Location”
Nah, good program design uses the data type it needs. It’s just basic stuff that even self-taught people know. Any basic standards document will enforce that. Screen space is 2D so the implied data type is a Vector2D (actually IntVector2D but that’s another story entirely).
Once you get into C++ you start overloading your types so that they can cleanly convert to the correct alternative data structure. You could actually set it up so that the conversion takes a view transform and a screen position and returns the correct world space, then you get a nice and simple:
Vector2D ScreenPosition = GetCursorScreenPosition(); ScreenPosition.CameraTransform = Camera.Transform; Vector Location = ScreenPosition;
But I don’t think anyone at Epic thought of that.
And agreed, it should be called “ScreenPosition”. I don’t think Epic do a lot of peer review otherwise stuff like this would get caught by the pedantic coders.