How to make 2D physics objects graphics?
Hi, is there any way of creating graphics (as simple as one color) within Unity for 2D physics objects - in other words fill the collider with a color so it's visible.
Right now I only see it when I select it.
Thanks in advance.
Answer by Spinnernicholas · Dec 16, 2013 at 12:11 AM
Create a 1x1 pixel image that is white. Then, you can use it to create rectangular sprites and set their color in the editor.
Answer by raynor85 · Dec 05, 2015 at 06:05 PM
I suggest to create a 100x100 pixel white rectangle and a white circle with 100 pixel diameter and create one prefab for each of them. By default when you create an empty object in Unity3d and apply a Box Collider 2D or a Circle Collider 2D, you realize that they got the minimum size of 1, and by default the pixels to units setting is 100. If you don't change the custom settings every time you import your brand new prefabs, you will get the smallest sprite element possible having either a Box Collider 2D or a Circle Collider 2D. A game object having a 1x1px image is not ideal because if you want to apply a 2D collider into it the collider will be bigger than the sprite itself. You can always resize the sprite itself before applying any collider but it is just annoying and superficial.