Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Physics Core 2D project settings reference

Explore the project settings that manage the global settings for 2D Physics Core.
Read time 7 minutesLast updated 19 days ago

Explore the project settings that manage the global settings for 2D Physics Core. To open these settings, go to Edit >
Project Settings

?

> Physics Core 2D.
Note
This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
To open the Physics Core 2D project settings window, go to Edit > Project Settings… > Physics Core 2D.

Property

Description

Physics Core SettingsAssigns a set of global settings for physics objects and the physics simulation. For more information, refer to Configure global 2D Physics Core settings.
Make AssetCreates a Physics Core Settings 2D asset and assigns it to Physics Core Settings. This button is available only while Physics Core Settings is empty.

Package

Component Defaults

The properties in this section set the default Callback Source value a component uses when you add a new component to a GameObject.

Section

Property

Description

Physics PoseCallback SourceSets the default Callback Source value for a newly added Physics Pose component. Existing components keep their own value. For more information, refer to Physics Pose component reference.
Physics AreaCallback SourceSets the default Callback Source value for a newly added Physics Area component. Existing components keep their own value. For more information, refer to a Physics Area component's reference page, for example Physics Area Circle component reference.
Physics ConstraintCallback SourceSets the default Callback Source value for a newly added Physics Constraint component. Existing components keep their own value. For more information, refer to a Physics Constraint component's reference page, for example Physics Constraint Distance component reference.

Custom Properties

Use the properties in this section to pin properties to the top of a component's
Inspector

?

window. For more information, refer to Pin properties in 2D Physics Core.

Property

Sub-property

Description

OffN/ADisables pinned properties for the project. This is the default.
Custom property assetsN/ALists the custom properties assets in the project folder. For more information, refer to Custom property asset properties.
N/ARadio buttonActivates the custom property group, so Unity pins the properties to the top of the component's Inspector window.
N/AMake AssetCreates a Custom Properties asset and assigns it to the item.
N/A✕Removes the item from the list. This doesn't delete the Custom Properties asset itself.
Add CustomN/AAdds a custom property field to the list, so you can assign a custom properties asset to it.

Custom property asset properties

Property

Description

NameSets the name of the Custom Properties asset.
Add Component TypeAdds a component type you want to pin properties for.
Each component type section has the following properties:

Property

Description

RemoveRemoves the component type section.
PropertiesThe properties Unity pins to the top of the component's Inspector window. Click and drag the handle to change the order of a property. Use the checkbox to enable or disable a property. Select X to remove a property from the list.
Add PropertyAdds a property to pin to the top of the component's Inspector window.

Settings

The Settings tab contains the settings from the Physics Core Settings 2D asset you assign to the Physics Core Settings property.

Layers

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

Property

Description

Physics Layer NamesSets the names of the 64 layers 2D Physics Core uses if you enable Use Physics 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

The General section contains the following properties.

Property

Description

Physics World DefinitionSets the initial properties of a new physics world. For more information, refer to Physics Simulation Definition asset reference.
Physics Body DefinitionSets the initial properties of a new physics body. For more information, refer to Physics Pose component reference.
Physics Shape DefinitionSets the initial properties of a new physics shape.
Physics Chain DefinitionSets the initial properties of a new physics chain.

Joints

The Joints section contains the following properties.

Property

Description

Physics Distance Joint DefinitionSets the initial properties of a new distance joint. For more information, refer to Physics Constraint Distance component reference.
Physics Fixed Joint DefinitionSets the initial properties of a new fixed joint. For more information, refer to Physics Constraint Fixed component reference.
Physics Hinge Joint DefinitionSets the initial properties of a new hinge joint. For more information, refer to Physics Constraint Hinge component reference.
Physics Relative Joint DefinitionSets the initial properties of a new relative joint. For more information, refer to Physics Constraint Relative component reference.
Physics Slider Joint DefinitionSets the initial properties of a new slider joint. For more information, refer to Physics Constraint Slider component reference.
Physics Wheel Joint DefinitionSets the initial properties of a new wheel joint. For more information, refer to Physics Constraint Wheel component reference.

Global

Property

Description

Auto-Edit Active SettingEnables editing the properties of the active Physics Core Settings 2D asset. Disable the setting to edit the settings of the Physics Core Settings 2D asset you select in the Project window instead.
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 how Unity combines the Categories and Contacts properties of two shapes to decide whether they make contact. The options are:
  • Both: Creates a contact only if each shape's Contacts property includes the other shape's Categories property. This is the default.
  • Either: Creates a contact if either shape's Contacts property includes the other shape's Categories property.
For more information, refer to Contact filter modes.
Contact Filter Group ModeDetermines how Unity uses the Group Index property of two shapes to decide whether they make contact. The options are:
  • Group: A Group Index other than 0 overrides the Categories and Contacts properties. Two shapes with the same positive value always make contact, and two shapes with the same negative value never make contact. If either shape has a value of 0, or the two values are different, Unity uses Categories and Contacts instead. This is the default.
  • Filtering: Group Index filters the result of the Categories and Contacts properties. Two shapes with different values never make contact, and two shapes with the same value make contact if Categories and Contacts allow it.
For more information, refer to Contact filter modes.
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.
Initial World CapacitySets the number of worlds Unity allocates. Unity always creates one physics world by default, and allocates more worlds if it needs to. The default is 4, and the range is 1 to 1024.
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 2D Physics Core using the 64 layers in the Layers section. If you disable this property, 2D Physics Core uses the 32 GameObject layers instead. For more information, refer to Configure collisions between 2D Physics Core objects.
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