Version: 2023.1
Language : English
Body Type: Static
Collider 2D

Rigidbody 2D properties: Simulated

The Simulated property is common to all available Body TypesDefines a fixed behavior for a 2D Rigidbody. Can be Dynamic (the body moves under simulation and is affected by forces like gravity), Kinematic (the body moves under simulation, but and isn’t affected by forces like gravity) or Static (the body doesn’t move under simulation). More info
See in Glossary
. Use this property to start (enabled) or stop (disabled) a RigidbodyA component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary
2D and any attached ColliderAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary
2Ds and JointA physics component allowing a dynamic connection between Rigidbody components, usually allowing some degree of movement such as a hinge. More info
See in Glossary
2Ds from interacting with the 2D physics simulation. Changing this property is more memory and processor efficient than enabling or disabling individual Collider 2D and Joint 2D components.

When you enable the Simulated property, the following occurs:

  • The Rigidbody 2D moves via the simulation (gravity and physics forces are applied).
  • Any attached Collider 2Ds continue creating new contacts and continuously reevaluate contacts.
  • Any attached Joint 2Ds are simulated and constrain the attached Rigidbody 2D.
  • All internal physics objects for Rigidbody 2D, Collider 2D, and Joint 2D stay in memory.

When you disable the Simulated property, the following occurs:

  • The Rigidbody 2D isn’t moved by the simulation (gravity and physics forces aren’t applied).
  • The Rigidbody 2D doesn’t create new contacts, and any attached Collider 2D contacts are destroyed.
  • Any attached Joint 2Ds aren’t simulated, and don’t constrain any attached Rigidbody 2Ds.
  • All internal physics objects for Rigidbody 2D, Collider 2D, and Joint 2D remain in memory.

Improve efficiency with the Simulated property

You can stop and start individual elements of the 2D physics simulation by enabling and disabling physics related components individually on both Collider 2D and Joint 2D components. However, enabling and disabling individual elements of the physics simulations means internal GameObjectsThe 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
and physics-based components are constantly created and destroyed, which can cost high memory usage and processor power. Therefore, it’s more efficient to disable the physics simulation entirely rather than disabling the individual components.

Note: When you disable a Rigidbody 2D’s Simulated option, any attached Collider 2D is effectively ‘invisible’ and can’t be detected by any physics queries, such as with Physics.Raycast.

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