Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Clone()

Creates a new PhysicsWorld that is a copy of this world, including all of its PhysicsBody, PhysicsShape and PhysicsJoint.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public PhysicsWorld Clone()

Returns

Type

Description

PhysicsWorldThe cloned world.

Remarks

The clone is a separate world, so handles you hold for this world do not resolve against it; enumerate the clone with PhysicsWorld.GetBodies and similar. The clone is not owned and its _userData is not copied; callback options come across but any callback targets must be set on the clone.