Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Plane.SetNormalAndPosition

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public method SetNormalAndPosition(inNormal: Vector3, inPoint: Vector3): void;
public void SetNormalAndPosition(Vector3 inNormal, Vector3 inPoint);

Parameters

inNormalThe plane's normal vector.
inPointA point that lies on the plane.

Description

Sets a plane using a point that lies within it along with a normal to orient it.

Note that the normal must be a normalised vector.

var fieldLength: float;
var fieldWidth: float;
var goalLine1: Plane;
var goalLine2: Plane;
var leftSideLine: Plane;
var rightSideLine: Plane;

function Start () { // Set up goal lines of a playing field. goalLine1.SetNormalAndPosition(Vector3.forward, Vector3.forward * fieldLength / 2); goalLine1.SetNormalAndPosition(-Vector3.forward, -Vector3.forward * fieldLength / 2);

// Set up side lines. leftSideLine.SetNormalAndPosition(-Vector3.right, -Vector3.right * fieldWidth / 2); leftSideLine.SetNormalAndPosition(Vector3.right, Vector3.right * fieldWidth / 2); }
no example available in C#

See Also: Set3Points.

Did you find this page useful? Please give it a rating: