Plane plane = new Plane(Vector3.up, 0); Vector3 point = new Vector3(0, 1, 0); if (plane.GetSide(point)) { Debug.Log("The point is on the positive side of the plane"); } else { Debug.Log("The point is on the negative side of the plane"); }
Plane plane = new Plane(Vector3.up, 0); Vector3[] points = new[] { new Vector3(0, 1, 0), new Vector3(1, 1, 1), new Vector3(2, 1, 0) }; foreach (Vector3 point in points) { if (plane.GetSide(point)) { Debug.Log(point.ToString() + " is on the positive side of the plane"); } else { Debug.Log(point.ToString() + " is on the negative side of the plane"); } }In this example, an array of points is defined and a loop is used to iterate through each point and determine whether it is on the positive or negative side of the plane. Package library: UnityEngine.