Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UpdateVertices(ReadOnlySpan<Vector2>, bool)

Update the existing ChainSegment shapes with the provided vertices. Modifying the vertices will cause contacts to be recalculated however it may cause overlaps and/or collision tunnelling if not used carefully. The number of vertices provided and looping option should be the same as was used when the Chain was originally created. Any mismatch between the two will result in a warning.
Read time 1 minuteLast updated 9 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public void UpdateVertices(ReadOnlySpan<Vector2> vertices, bool isLoop)

Parameters

The vertices used to update the existing ChainSegment shapes.

isLoop

Indicates a closed chain formed by connecting the first and last vertices specified. This should match what was originally specified in _isLoop.