Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsCore 2D project settings reference

Learn about Physics Core 2D API settings.
Read time 3 minutesLast updated 18 days ago

The following Project settings manage the global settings for the Physics Core 2D API.
Note
This documentation is about writing C# scripts using the
Unity.U2D.Physics
API. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
To open the PhysicsCore 2D project settings window, go to Edit > Project Settings… > PhysicsCore 2D.
Note
To manage the global settings for 3D physics instead, refer to the Physics project settings reference.

Property

Description

Physics Core SettingsAssigns a set of global settings for physics objects and the physics simulation when you use the Physics Core 2D API. For more information, refer to Configure global Physics Core 2D API settings.

Settings

The settings tab contains the settings from the PhysicsCore Settings file.

Layers

The properties in this section configure the layers Unity uses to detect collision. For more information, refer to Configure collisions between Physics Core 2D API objects.

Property

Description

Physics Layer NamesSets the names of the 64 layers the
PhysicsMask
API uses if you enable Use Full Layers. By default, the first layer has the name Default and the other layers have no name.

Default Definitions

The properties in this section set the default values when you create a new definition object. For the individual sections, refer to the following:

General

Joints

Global

Property

Description

Transform Change ModeSets when Unity sends notifications to callbacks when the transform of a physics body changes. The options are:
  • Off: Doesn't send notifications.
  • Frame Start: Sends notifications at the start of the frame.
  • Fixed Update: Sends notifications during the
    FixedUpdate
    event stage.
  • Update: Sends notifications during the
    Update
    event stage.
For more information, refer to Event functions.
Contact Filter ModeDetermines when Unity reports a contact event between two shapes that have contact filters. The options are:
  • Both: Reports a contact event only if both shapes have contact filters that include each other.
  • Either: Reports a contact if either shape has a contact filter that includes the other.
For more information, refer to
PhysicsShape.ContactFilter
.
Rendering ModeDetermines whether Unity draws a debug visualization in a built project. The options are:
  • Editor Only: Draws only in the Unity Editor.
  • Development Player: Draws in the Editor, and a built project if Development Build is enabled. For more information, refer to Build Profiles window reference.
  • Any Player: Draws in the Editor and built projects.
For more information, refer to Draw a debug visualization of objects.
Maximum WorldsSets the maximum number of worlds that can exist at the same time. Unity always creates one physics world by default.
Concurrent SimulationsSets the number of physics simulations that can run at the same time. The default is 2.
Length Units Per MeterSets the number of Unity units that correspond to one meter in the physics simulation. The default is 1.
Use Physics LayersEnables the
PhysicsMask
API using the 64 layers in the Layers tab. If you disable this property, the
PhysicsMask
API uses the 32 GameObject layers instead.
Disable SimulationStops the simulation. You can still use the API as normal while the simulation is stopped.
Always Draw WorldsCreates a
DrawResults
object with the debug draw visualization, even if you set Rendering Mode to disable drawing in a built project. For more information, refer to PhysicsWorld.DrawResults.

Additional resources