Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetPositions

Get the positions of all vertices in the trail.
Read time 1 minuteLast updated 5 days ago

Definition

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

GetPositions(Vector3[])

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

Parameters

positions

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.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: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.

GetPositions(NativeArray<Vector3>)

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

Parameters

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.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: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.

GetPositions(NativeSlice<Vector3>)

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

Parameters

The array of positions to retrieve.

Returns

Type

Description

intHow many positions were actually stored in the output array.

Remarks

This method is preferred to TrailRenderer.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: TrailRenderer.positionCount property.
Additional Resources: TrailRenderer.GetPosition function.