Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Created January 19, 2016 13:55
Show Gist options
  • Save david-hodgetts/5f6eba8eeb3df640aa56 to your computer and use it in GitHub Desktop.
Save david-hodgetts/5f6eba8eeb3df640aa56 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ShowMyTransforms : MonoBehaviour {
void OnDrawGizmos(){
Gizmos.color = Color.red;
Gizmos.DrawLine (transform.position, transform.position + transform.right);
Gizmos.color = Color.blue;
Gizmos.DrawLine (transform.position, transform.position + transform.forward);
Gizmos.color = Color.green;
Gizmos.DrawLine (transform.position, transform.position + transform.up);
}
}
@olange
Copy link

olange commented Jan 20, 2016

I wrote a variant of this useful gizmo, that displays the axis only when the game object is selected; it displays also small spheres at the origin and end of the right/forward/up axis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment