# GetName()

> Get the name of the world, or "World #N" where N is the _index when no name has been set. The _defaultWorld is always named "Default World".

## Definition

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

```csharp
public string GetName()
```

### Returns

| Type                                                           | Description            |
| -------------------------------------------------------------- | ---------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The name of the world. |

### Remarks

A new string is allocated each call, as with any API returning a string such as ToString. See [PhysicsWorld.SetName](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld/setname.md).
