How would i get the size of an object from this perspective?

Hello, i was wondering how to get the size of an object in the perspective of the red rectangle that i edited in the images below

My goal is to get a part’s “global” size independantly of how it’s rotated, since when you get the part.Size it gives the part’s definitive size instead of the “global” size.
This would be mostly used for raycasting floor detection purposes.

Well my guess would be to calculate where the corners of the part are and then use worldtoscreenpoint to convert it to positions you can use to create a rectangle, once you have the rectangle you could probably just do some math based on the distance between those points

3 Likes

Had to play around with that method and it worked! Thanks

I don’t mean to bump the topic anymore, but this is commonly referred to as a bounding box. It applies to 3 dimensions too (well all dimensions). For example when you select a model the blue outline is depicting the bounding box of the model. Thought this would be helpful :slightly_smiling_face:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.