Empty Game objects are very hard to see, so I thought it would make it easier if I could make them visible in the editor and invisible during gameplay.
Enter Gizmos.
Gizmos are the small icons and that appear in the editor and does not appear in-game. Like the camera icon you can see in the viewport for the main camera.
Add this function to a script attached to a gameObject with a Collider, BoxCollider2D in my case. Afterwards, you will get an red box that is the size of the trigger area.
void OnDrawGizmos()
{
// Draw a semitransparent red cube at the transforms position
var triggerBox = GetComponent<BoxCollider2D>();
Gizmos.color = new Color(1, 0, 0, 0.5f);
Gizmos.DrawCube(transform.position,
new Vector3(triggerBox.size.x, triggerBox.size.y, 1));
}
Or if you just need something more simple you can use this.
void OnDrawGizmos()
{
// Draw a semitransparent green cube at the transforms position
Gizmos.color = new Color(0, 1, 0, 0.5f);
Gizmos.DrawCube(transform.position, new Vector3(1, 1, 1));
}
I hope someone will have a better day with the help of this information. 😀
read more about Gizmos here https://docs.unity3d.com/ScriptReference/Gizmos.html