I am not sure it is a bug or a feature which I did not dig deeply enough.
Basically, the following the blueprint is a just test to print out mouse location and the screen location which is converted from a world location, which is converted from mouse location. I hope you understand what I mean. So I expect the output result should be same.
However, with different resolution scale, it returned very different result. Here are the results, Red text is mouse location and blue text is location after conversion.
First Test: Resolution scale 100%,
Second Test: Resolution scale 25%,
So with 25% scale, the location is at half position location.
My question is if it is expected result or a bug. What is best way to get correct screen location independent from resolution scale?
We were able to reproduce this behavior and have entered a bug report (UE-6191). We are not certain whether the Get Mouse Position or the Convert World Location to Screen Location is incorrect when the Resolution Scale is adjusted, but it seems that they should match. We will let you know when we see an update on the bug. Thanks for the report!
The bug is still currently in testing and attempting to be resolved. This is all the information I can provide at this time. We will let you know when this bug has been fixed within the upcoming hot fixes and/or release notes for the engine.
Alright thanks, in the meantime however I figured out that it’s just a simple matter of dividing the Vector2D with the resolution scale.
For example in code you can do something like this:
static const auto CVarScreenPercentage = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT(“r.ScreenPercentage”));
float ScreenPercentage = CVarScreenPercentage->GetValueOnGameThread() / 100.f;
But r.ScreenPercentage is not exposed in blueprints unfortunately so it’s only possible from C++ afaik.
At any case this seems like a simple fix so I would hate to see this not fixed in 4.7 because of priority reasons
Thanks anyway! keep up the good work.