Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


2D physics with the LowLevelPhysics2D API

Create and control a 2D physics scene using the LowLevelPhysics2D API.
Read time 1 minuteLast updated 8 days ago

Create and control a 2D physics scene in a C# script using the
LowLevelPhysics2D
API.
Note
This documentation is about writing C# scripts using the
LowLevelPhysics2D
API. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.

Topic

Description

Get started with the LowLevelPhysics2D APILearn about the
LowLevelPhysics2D
API and how to create a 2D physics scene.
Creating a scene with the LowLevelPhysics2D APICreate and debug a scene that uses 2D physics.
Configuring LowLevelPhysics2D API scenesConfigure 2D physics objects and global settings, and attach custom data to physics objects.
Collisions and interactions in the LowLevelPhysics2D APIEnable and detect collisions between 2D physics objects, and cast rays to check for intersections.
Run 2D physics in 3D space using the LowLevelPhysics2D APICreate a 2D physics world at any angle in 3D space, instead of the traditional x, y plane that faces the camera.
Optimize the LowLevelPhysics2D APITo improve the performance of 2D physics, run the simulation and your own code on multiple threads.
Reference for the LowLevelPhysics2D APIExplore the properties and settings you can use to configure the global settings of the
LowLevelPhysics2D
API, and set the default values for objects like worlds, bodies, and shapes.

Additional resources