How to correctly get mouse position?

Hello.

I am working on Level Building Mode in my “game”.

Now I have Build Mode Switcher:

http://s6.postimg.org/gvh58y7ox/screenshot_56.png

When Building Mode switched on, I want do draw wall with placing Static Mesh like in https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprints_Advanced/1_2/index.html

https://docs.unrealengine.com/latest/images/Resources/ContentExamples/Blueprints_Advanced/1_2/AdvBP_1_2_ConstructionScript.png

I calculate my StartPos vector with blueprint:

http://s6.postimg.org/bzdih97jl/screenshot_58.png

and my EndPost vector blueprint:

http://s6.postimg.org/6ch5js50x/screenshot_59.png

After that I trying to calculate count wall needed to place:

http://s6.postimg.org/xbplsogvl/screenshot_60.png

And some debug info:

http://s6.postimg.org/exf2op4kx/screenshot_61.png

And show Mouse cursor script:

http://s6.postimg.org/b2bom4lf5/screenshot_62.png

Now I have got an issue with calculation of the mouse cursor position:
Left side of floor is X=0:

http://s6.postimg.org/6izg0m3jl/screenshot_64.png

But when I click in the game, X!= ~ 0:

http://s6.postimg.org/jbnk0jf5d/screenshot_69.png

And another error - width of the vertical mesh about 20-30 points but calculated mouse position shows ~100:

http://s6.postimg.org/fgk5xyvzl/screenshot_70.png

How to calculate mouse position more accurately?

Hi , just for a debug.

On left click, do a line trace, and on second click, do another line trace?

After I update UE4,will try something like that and see if I get any better results?

Hi

500x500x500 cube

Did line trace and got reasonable close results when I was up close to wall.

45143-capture.jpg

But the further away I got, somewhat the same results.

Aaaaaand? How to fix this?

Via “line trace”

This is how I do it.

This is just how I did printstring, just in case.

Nice! Thank you!

Tell me how it turns out

http://s6.postimg.org/an506uovl/screenshot_80.png

http://s6.postimg.org/d5qp7jalt/screenshot_81.png

Was it more accurate??

Don’t make me wait?

Yep, it’s works good.
Thank you very much!

Happy to help

Resolved and on to the next thing.