Hi, I am trying to figure out how to get the world positions of the corners of the player’s screen, How would I do this? I’ve looked at other posts but cant seem to figure it out.
Thank you
Hi, I am trying to figure out how to get the world positions of the corners of the player’s screen, How would I do this? I’ve looked at other posts but cant seem to figure it out.
Thank you
Something like this
local workspace = game:GetService("Workspace")
local camera = workspace.CurrentCamera
local vs = camera.ViewportSize
function getworldpoint(x,y)
local ray = camera:ScreenPointToRay(x, y)
local worldposition = ray.Origin + ray.Direction * 1
return worldposition
end
getworldpoint(1,1) --TopLeft
getworldpoint(vs.X,vs.Y) --BottomRight
getworldpoint(vs.X,1) --TopRight
getworldpoint(1,vs.Y) --BottomLeft
Alright this is kind of what i was looking for, how would I go about making this so it stays at that same angle that the camera is looking at and goes down to y 0
Sorry ignore this I mixed up our dm’s with the post
So look at this image i just drew up as a representation
So do you want it so the points can’t go under y 0 zero?
yes exactly, the camera looks down on the map and I need the points to be at the corners or the players screen at y0 but obviously cant just set the points y to 0 because then the position of those points wouldn’t be what the camera views
I don’t know how to do that, I’ll try and work it out though.
akright thank you
thirtycharacters