Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetPositions

Get the positions of all vertices in the line.
Read time 2 minutesLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetPositions(Vector3[])

Get the positions of all vertices in the line.
public int GetPositions(Vector3[] positions)

Parameters

positions

The array of positions to retrieve. The array passed should be of at least LineRenderer.positionCount in size.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to LineRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: LineRenderer.positionCount property, LineRenderer.GetPosition function.

GetPositions(NativeArray<Vector3>)

Get the positions of all vertices in the line.
public int GetPositions(NativeArray<Vector3> positions)

Parameters

The array of positions to retrieve. The array passed should be of at least LineRenderer.positionCount in size.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to LineRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: LineRenderer.positionCount property, LineRenderer.GetPosition function.

GetPositions(NativeSlice<Vector3>)

Get the positions of all vertices in the line.
public int GetPositions(NativeSlice<Vector3> positions)

Parameters

The array of positions to retrieve. The array passed should be of at least LineRenderer.positionCount in size.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to LineRenderer.GetPosition when retrieving all positions, as it is more efficient to get all positions using a single command than to get each position individually.
Additional Resources: LineRenderer.positionCount property, LineRenderer.GetPosition function.