Tool to help you visualize 2d physics colliders and joints. You can track their transform at runtime. Just add the proper component to GameObject with a Collider2D. Supported Unity 5.6 and higher.
Warning: Objects with scaled parent can render incorrectly.
You can visualize colliders in two ways: rendering them as mesh and using editor gizmos. Frist method needs more steps to get result, second - is very simple but works only in Editor and need to attach different components for each type of Collider2D. Also, this package includes GUI tools to batch some operations with both types of visualizers.
New version supports visualizing through Collider2dRenderer which renders colliders shape to standard mesh. This type of visualization lacks most features of the gizmos-based visualizers but it works in standalone builds, can be batched in one draw call to minimize graphics overhead impact.
AlwaysUpdate
- updates mesh every frameMeshColor
- vertex color of the meshUseMaterialPropertyBlock
- Set color by material property blockSetVertexColors
- Set vertices colors withMeshColor
valueUseCircleProximity
- use a custom number of segments created for circular areas of CircleCollider2D and CapsuleColldier2D. If not checked default value will be used (20). You can set the default value by accessing static variable Collider2dPointsGetter::CircleProximity.CustomCircleProximity
- use a custom number of segmentsThickness
- the thickness of shape in Unity points. If a camera is Orthogonal andUsePixelSize
is true it will be in pixel sizeUsePixelSize
- to set mesh thickness in pixels
You can automate routine operations for you visualizers with the new manager which can be found at "Tools/Physics2dVisualizer/Open Manager" menu.
AnchoredJoint2DVisualizer
- forDistanceJoint2D
,FixedJoint2D
,FrictionJoint2D
,HingeJoint2D
,SliderJoint2D
,SpringJoint2D
,WheelJoint2D
Box2dVisualizer
forBoxCollider2D
(EdgeRadius not supported)Capsule2dVisualizer
forCapsuleCollider2D
Circle2dVisualizer
forCircleCollider2D
Edge2dVisualizer
forEdgeCollider2D
Polygon2dVisualizer
forPolygonCollider2D
(Multiple polygon Paths not supported)MovementLogger
for tracking object's position and transform
- Don't forget to enable Gizmos visibility
IsVisible
Enables or disables rendering of collider.DynamicBounds
Updates bounds of collider every time OnDrawGizmos calls. Useful when you changing Offset, Size, Radius, e.t. of the collider. If you don't just disable to increase performance.Color
Color of rendered collider.
BufferSize
limit number of records, set 0 if unlimitedRecordInterval
limit time of data storing, set 0 if you wat to do it every UpdateColor
Color of visualizationRecord
enable recordingDrawPoints
enable visualizing of position pointsDrawLines
enable visualizing of pathRecordObjectState
Records collider visualizer state, requires class inherited from BaseVisualizerRecordUnmoved
record state even when the object wasn't movedDrawState
Draws collider visualizer state
This tools can help you to automate some routine operations without opening manager window.
Remove all visualizers
- removes all gizmos visualizers found in the sceneAdd visualizers for all Colliders2d
- automatically adds relevant gizmos visualizers for all Collider2D found in the sceneRemove all Collider2dRenderer
- removes all Collider2DRenderer found in the sceneAdd the Collider2dRenderer for all Colliders2d
- automatically adds Collider2Renderer visualizer for all Collider2D found in the sceneAdd default sprites material for all Colliders2d
- sets shared material based on "Sprites/Default" shader for all Collider2Renderer found in the scene