How to size part to screen size

Hi there,

i want to make a part the size of the screen, the exact size, i have been unable and cannot think of how to do it, this is because i want to spawn parts in a certain radius and i want it so scale on all screens, there is one main part that they get scaled in, i also want to get the edges of this part to know the place where i can position them.

In summary i want to scale a part so it fits in the screen and i want to know what the corner positions are so i can calculate the random position where i can place my part.

Thanks, kieran :slight_smile:

2 Likes

I don’t understand what you want to do. Is the player looking at a part that fills up the entire screen?

Don’t think this is possible since placing a Part that fits on a square screen vs a rectangular screen would require knowing the devices screen size, knowing the Camera position and viewing angle, and making the Part that size.
Why not fix the camera over a large baseplate that’s over the size of any screen and using a border to outline the area available to spawn Parts?

I’m unsure why you need to do this… Creating Uis may be your solution. (If you are trying to create the camera movement for a simulator shop, the size isn’t affected greatly)

Take a look at Stravant’s ScreenSpace module. It has the math and functions to take care of what you want here.

There is a fixed camera, and it is looking in the direction of the part, i want to automatically scale the part so it fits the entire screen and then calculate the top left, top right, bottom left and bottom right of that part.

1 Like

All of these are existing properties of the camera object.