Skip to content

Instantly share code, notes, and snippets.

@anchan828
Created July 20, 2012 13:29
Show Gist options
  • Save anchan828/3150720 to your computer and use it in GitHub Desktop.
Save anchan828/3150720 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Test : MonoBehaviour
{
//targetB
private Plane plane;
public Transform targetA;
void Start ()
{
plane = new Plane (transform.up, transform.position);
}
void Update ()
{
plane.SetNormalAndPosition (transform.up, transform.position);
if (plane.GetSide (target.position)) {
Debug.Log ("Up");
} else {
Debug.Log ("Down");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment