Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsChainDefinition

A PhysicsChain definition used to specify the chain of vertices that will produce multiple ChainSegmentGeometry shape types. Additionally, non-geometric properties can be specified here.
Read time 1 minuteLast updated 9 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsChainDefinition

Constructors

Constructor

Description

PhysicsChainDefinition()Create a default PhysicsChain definition.
PhysicsChainDefinition(System.Boolean)Create a default PhysicsChain definition.

Properties

Property

Description

contactFilterThe contact filter used to control which contacts this shape can participate in.
isLoopIndicates a closed chain formed by connecting the first and last vertices specified. When enabled, no ghost vertices should be defined in the _vertices with all being used to define ChainSegmentGeometry with the ghost vertices being calculated automatically to force a closed loop. When disabled, the _vertices should define _ghost1 as the first vertex followed by at least two vertices or more defining the subsequent edges and finally a _ghost2 vertex, therefore there must be at least 4 vertices.
surfaceMaterialThe surface material for the shape comprising of many properties such as friction, bounciness, rolling resistance etc.
triggerEventsControls whether this chain produces trigger events which can be retrieved after the simulation has completed. This applies to triggers and non-triggers alike.

Static Properties

Property

Description

defaultDefinitionGet a default PhysicsChain definition.