Question about Frame of the target, Any one help?

Hello, anyone.
please view the pictures flow:




You can see the white frame around the battleship. I want to know how to program make the white frame?

because the different camera angle, the target(battleship)'s white frame changed.

I don’t know how to program on js for it.

Thanks.

yours Shawn :sweat_smile:

The general idea of the code would be something like:

Build a list of 6 points, the corners of the bounding box of the ship.
Convert each of those point to screen space using Camera.main.WorldToScreenPoint.
Create a Rect whose parameters are (points[0].x, points[0].y, 0, 0). Then loop through each point and expand the rect to contain each one.
The rect will now contain a rect of the size you’re looking for.

Yeah, I solute it. use the same way like yours.
Thank you, StarManta.
:smile: