Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I convert screen space to world space?

Asked by 8 years ago

I am making a custom 2D cursor for console users but i need help. I can not figure out how to turn screen space into world space. There is no Roblox API function to use and i do not know of a viable algorithm to use for this.

If someone can point me in the right direction or find a solution to my problem, that would be appreciated.

0
If no body has an answer to this is there any alternatives to making a joystick device select objects in 3D space. SciGuy2002 15 — 8y
0
I've never done console development but I can skim the wiki a little bit and see if I can come up with something. I would recommend doing the same. AZDev 590 — 8y
0
I don't have an XBox and have no way to mess around with any of the XBox API. Is there not already a cursor built in? AZDev 590 — 8y
0
Here is a module that might help you. https://www.roblox.com/library/170340248/ScreenSpace-Module This was made by stravant. You could either use this or just simply look at the code to get an idea of how to go about solving your problem. AZDev 590 — 8y
0
You can also play with a controller on PC, if that helps. Link150 1355 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

http://wiki.roblox.com/index.php?title=API:Class/Camera/ScreenPointToRay

Basically, use that ray's Origin and Direction to create Ray.new(origin, direction.unit*999) and FindPartOnRay to find where the mouse is pointing.

Ad

Answer this question