Inaccurate Cursor/Trace World location

Hi everybody!

I created some blueprints to get the world location of my mouse. An actor follow my cursor on my terrain. No problem so far.

But, I’m in trouble! The world location seems to be inaccurate: at the center of the world, locations are very precise, to the nearest comma. But near bounds, the precision is very weak!

This is a representation of my sensation of “grid” with the trace:

https://puu.sh/xLXO6/fa545cdc4e.jpg

You can see this is relative to X ans Y! Corners are the least accurate.

Maybe because my world is too big (-12 000 000 to 12 000 000…)? I don’t understand…

And this is my Trace blueprint (I put the print to see values):

https://puu.sh/xLYHd/aff82280ec.jpg

Thank you very much for help!

Hi everybody!

I tried to trace cursor in a blank project, without starter content, and the problem is the same :confused:
I also tried to use directly a “Get Hit Result under Cursor by Channel” instead of Convert+Trace. The result is exactly the same.

I hope someone would have a solution about that…

This is a float precision error. No double precision float in blueprints. Yet.

In UE4, after around 500000 units, you will start noticing inaccuracy. It is not engine specific, really. That’s why you do not have big worlds in games. Not as is. Things are often faked. In UE4 you can shift world origin, so the location at X: -1,250,500.0 | Y: 2,000,000.0 becomes 0,0 and you calculate things from there on.

You should also consider dividing your world into smaller chunks and take advantage of level streaming and world composition:

More info on float precision:

Oh ok! I see. I suspected this was a problem about the size, but not about double precision!
Thank you for your explanations, and for the link to Computerphile channel on youtube!