Do you know how to get the World Space location from Point on screen?

Hi I’m making an RTS and in this I need to get know where the world space is based off of a point on the screen.

Now I can do this for the mouse, I use this script:

Now this works great for the mouse pointer. But I want to be able to get the world position from a 2DVector that is not the mouse.

Ideally some kind of node like this:

but just accept a 2d Vector.

Thanks guys

Ed

Try it like this:

Wouldn’t that just return world position base on the mouse position? I’m looking to provide an X,Y coordinate then get the world space from that.

Vector that is not the mouse

Oop, somehow I read it the other way round, my bad. The node you’re after is called Deproject Screen to World

I have tried the Deproject, but I always seem to get 0,0,0
Regardless of the vector I enter. Can you see if I’m doing something wrong:

Connect Player Controller to the Deproject node.