- Home /
How do I display the objects collider box in a running scene
Hello,
How do I make the collider box I have added to an object appear for the user in a running environment?
Thanks!
Answer by codeguyross1 · Nov 06, 2012 at 11:08 PM
I believe I may have found an answer after looking for examples on drawing lines in unity. The user tomekkie2 has the following website where he has created an example virtualplayground. Once I have worked through his example I will post the solution here.
The code found on virtualplayground did the trick. All I had to do was drop one script on the camera and the other on the object. I ran the scene and clicked on the object and the collider bounding box parameter appeared. The parameter isnt actually the collider box box but rather a shader drawn on the object to represent the collider box. So far this is the best solution I have found for drawing the collider box or some would say bounding box parameter.
Answer by DaveA · Nov 06, 2012 at 10:21 PM
I think the Vectrosity package (everyone should own) has a thing for that. Short of that, you could get the size and instantiate a box or sphere or whatever as a child of the object, maybe set its material to a semi-transparent thing.
Vectrocity seems a bit overkill for what I am after. I would prefer to code the answer myself rather than use a pre-created tool. This example does point me in another direction. I can create the box myself using lines I draw in 3D space.
Your answer
![](https://koobas.hobune.stream/wayback/20220613083449im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Pickup Bullets 1 Answer
Need some help an object collider that stops a timer then displays it on another scene 1 Answer
How to Code Obstacle to Go Back Into My Object Pooler When They Collide With a Boundary? 0 Answers
How to specify a a rigid body colliding with the bottom area of an object 2 Answers