Skip to content

Instantly share code, notes, and snippets.

@ZeredaGames
Created December 30, 2018 03:21
Show Gist options
  • Save ZeredaGames/d537e1abd60d88372993d171172991f5 to your computer and use it in GitHub Desktop.
Save ZeredaGames/d537e1abd60d88372993d171172991f5 to your computer and use it in GitHub Desktop.
Unity Gizmo Function
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class DrawOnGizmoDrawRay : MonoBehaviour {
public float gizmoSpeed = 1f;
public object gizmoedObject;
Vector3 direction, isRay;
public void OnDrawGizmos()
{
isRay = transform.TransformDirection (Vector3.forward) * gizmoSpeed;
Gizmos.DrawRay (transform.position, direction);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment