Version: Unity 6.3 LTS (6000.3)
Language : English
LowLevelPhysics2D API workflow
Create a world with the LowLevelPhysics2D API

Creating a scene with the LowLevelPhysics2D API

Create and debug a sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
that uses 2D physics with 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
Create a physics world Create a new world to add 2D physics objects to, or fetch the default world Unity automatically creates.
Create a physics object Create a 2D physics body, then attach shapes to the body.
Add a sprite Add a SpriteRenderer component to a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
that has a physics script attached.
Move a GameObject Configure a 2D physics script to update the Transform componentA Transform component determines the Position, Rotation, and Scale of each object in the scene. Every GameObject has a Transform. More info
See in Glossary
of a GameObject.
Draw a debug visualization of objects Configure how Unity draws 2D physics objects in the Unity Editor or at runtime, and draw your own shapes.
Combine shapes To combine physics shapes into a compound shape, create a composer using a PhysicsComposer object.
Connect objects with joints Create a connection or constraint between two physics objects.
Destroy objects and manage memory Destroy a world, body, and shape when you no longer need them, and free up memory when necessary.

Additional resources

LowLevelPhysics2D API workflow
Create a world with the LowLevelPhysics2D API
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961