Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to create a bounding box gizmo over an area?

Discussion in '2D' started by jpom001, Jan 5, 2021.

  1. jpom001

    jpom001

    Joined:
    Dec 3, 2020
    Posts:
    69
    I am randomly assigning an object to a point on the screen, inside a particular area defined by a maxX, minX and a maxY and minY.
    Id like to create a box over this area so I can visualize where the points may occur during debugging.I assumed I could use a gizmo but it looks like I cant?
    Is the only way I can accomplish this through the LineRenderer?
    If so how would I define the Vector2's to represent the minX ,maxX and minY,maxY to create the box?
    Does anyone have an example of how to define these 4 Vectors? (I think I need 4)
     
  2. raarc

    raarc

    Joined:
    Jun 15, 2020
    Posts:
    535
    use debug.drawline