# Create

> Create a PhysicsWorld using the _defaultDefinition.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

## Create()

Create a PhysicsWorld using the [\_defaultDefinition](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/defaultdefinition.md).

```csharp
public static PhysicsWorld Create()
```

### Returns

| Type                                                                              | Description        |
| --------------------------------------------------------------------------------- | ------------------ |
| [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md) | The created world. |

## Create(PhysicsWorldDefinition)

Create a PhysicsWorld.

```csharp
public static PhysicsWorld Create(PhysicsWorldDefinition definition)
```

### Parameters

**** (\[PhysicsWorldDefinition]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition)): The world definition to use when creating the new physics world.

### Returns

| Type                                                                              | Description        |
| --------------------------------------------------------------------------------- | ------------------ |
| [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md) | The created world. |

### Remarks

You don't need to create a world before you add physics objects, because Unity automatically creates one you can fetch with [\_defaultWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/defaultworld.md). This method isn't thread-safe. Call it only from the main thread. A world starts running as soon as you create it. Set [\_paused](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/paused.md) to `true` to pause its simulation.

Additional Resources: [\_defaultWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/defaultworld.md), [PhysicsWorldDefinition](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition.md)

### Examples

```csharp
// Create a public world definition so its properties display in the
// Inspector window, then create a world from it.
using UnityEngine;
using Unity.U2D.Physics;

public class CreateWorld : MonoBehaviour
{
    public PhysicsWorldDefinition worldDefinition = new PhysicsWorldDefinition();
    public PhysicsWorld world;

    void Awake()
    {
        world = PhysicsWorld.Create(worldDefinition);
    }
}
```

## Create(Snapshot, PhysicsWorldDefinition)

Creates a new [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md) from `snapshot`, using `definition` for the settings a snapshot does not store.

```csharp
public static PhysicsWorld Create(PhysicsWorld.Snapshot snapshot, PhysicsWorldDefinition definition)
```

### Parameters

**** (\[Snapshot]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/snapshot)): A snapshot produced by [PhysicsWorld.CreateSnapshot](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/createsnapshot.md).**** (\[PhysicsWorldDefinition]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition)): The world definition supplying the settings the snapshot does not store.

### Returns

| Type                                                                              | Description                                                                                                                      |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md) | The created world restored to the snapshot state, or an invalid world if the snapshot was rejected or no world could be created. |

### Remarks

A snapshot restores the full simulation configuration, so these [PhysicsWorldDefinition](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition.md) properties are taken from `snapshot` and their values in `definition` are ignored: [\_gravity](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/gravity.md), [\_bounceThreshold](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/bouncethreshold.md), [\_contactHitEventThreshold](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/contacthiteventthreshold.md), [\_contactFrequency](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/contactfrequency.md), [\_contactDamping](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/contactdamping.md), [\_contactSpeed](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/contactspeed.md), [\_contactRecycleDistance](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/contactrecycledistance.md), [\_maximumLinearSpeed](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/maximumlinearspeed.md), [\_sleepingAllowed](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/sleepingallowed.md), [\_continuousAllowed](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/continuousallowed.md), [\_eventGroupingAllowed](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/eventgroupingallowed.md) and [\_capacity](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/capacity.md). All other `definition` properties are applied normally, for example [\_simulationWorkers](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/simulationworkers.md) and [\_simulationSubSteps](/engine/6000.7/script-reference/unity/u2d/physics/physicsworlddefinition/simulationsubsteps.md). To use a value other than the snapshot's, set the matching property on the returned world after this call. Creating and restoring a world processes the whole image, so this is not intended to be called at high frequency.
