Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateShape

Create a Circle shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
Read time 3 minutesLast updated 10 days ago

Definition

CreateShape(PhysicsBody, CircleGeometry)

Create a Circle shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, CircleGeometry geometry)

Parameters

The body to attach the shape to.

The shape geometry to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, CircleGeometry, PhysicsShapeDefinition)

Create a Circle shape attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, CircleGeometry geometry, PhysicsShapeDefinition definition)

Parameters

The body to attach the shape to.

The shape geometry to use.

The shape definition to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, PolygonGeometry)

Create a Polygon shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, PolygonGeometry geometry)

Parameters

The body to attach the shape to.

The shape geometry to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, PolygonGeometry, PhysicsShapeDefinition)

Create a Polygon shape attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, PolygonGeometry geometry, PhysicsShapeDefinition definition)

Parameters

The body to attach the shape to.

The shape geometry to use.

The shape definition to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, CapsuleGeometry)

Create a Capsule shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, CapsuleGeometry geometry)

Parameters

The body to attach the shape to.

The shape geometry to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, CapsuleGeometry, PhysicsShapeDefinition)

Create a Capsule shape attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, CapsuleGeometry geometry, PhysicsShapeDefinition definition)

Parameters

The body to attach the shape to.

The shape geometry to use.

The shape definition to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, SegmentGeometry)

Create a Segment shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, SegmentGeometry geometry)

Parameters

The body to attach the shape to.

The shape geometry to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, SegmentGeometry, PhysicsShapeDefinition)

Create a Segment shape attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, SegmentGeometry geometry, PhysicsShapeDefinition definition)

Parameters

The body to attach the shape to.

The shape geometry to use.

The shape definition to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, ChainSegmentGeometry, PhysicsShapeDefinition)

Create a Chain Segment shape attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, ChainSegmentGeometry geometry, PhysicsShapeDefinition definition)

Parameters

The body to attach the shape to.

The shape geometry to use.

The shape definition to use.

Returns

Type

Description

PhysicsShapeThe created shape.

CreateShape(PhysicsBody, ChainSegmentGeometry)

Create a Chain Segment shape, using its default definition, attached to the specified body. See PhysicsBody.CreateShape.
public static PhysicsShape CreateShape(PhysicsBody body, ChainSegmentGeometry geometry)

Parameters

The body to attach the shape to.

The shape geometry to use.

Returns

Type

Description

PhysicsShapeThe created shape.