What does a Rigidbody2D do?
The Rigidbody2D class essentially provides the same functionality in 2D that the Rigidbody class provides in 3D. Adding a Rigidbody2D component to a sprite puts it under the control of the physics engine. By itself, this means that the sprite will be affected by gravity and can be controlled from scripts using forces.
Which Rigidbody2D type will be influenced by gravity and physics forces?
Body Type: Dynamic. A Dynamic Rigidbody 2D is designed to move under simulation. It has the full set of properties available to it such as finite mass and drag, and is affected by gravity and forces.
What makes a rigidbody special in terms of game development?
A rigidbody is a property, which, when added to any object, allows it to interact with a lot of fundamental physics behaviour, like forces and acceleration. You use rigidbodies on anything that you want to have mass in your game. This helps in adding velocities and accelerations to the object when needed.
How does a trigger collider2d work on a rigidbody2d?
A trigger Collider2D does not invoke physics on a Rigidbody2D. They can be triggered by other Collider2Ds and are pushed through the OnTriggerEnter2D/Stay2D/Exit2D methods. A non-trigger Collider2D will invoke physics on a Rigidbody2D. This typically means the Rigidbody2D item will apply various forces if its Collider2D hits another Collider2D.
How does rigidbody2d work in Unity scripting?
All the Collider2D shapes attached to the Rigidbody2D are cast into the Scene starting at each Collider position ignoring the Colliders attached to the same Rigidbody2D. Returns a point on the perimeter of all enabled Colliders attached to this Rigidbody that is closest to the specified position.
What should rigidbody2d collision detection mode be set to?
Either the parent dynamic rigidbody’s or the child kinematic Rigidbody2D’s collision detection mode should be set to “continuous” instead of “discrete” or your object will still be pushed., although strangely and slowly.
What is the physical type of the rigidbody2d?
The physical behaviour type of the Rigidbody2D. The center of mass of the rigidBody in local space. The method used by the physics engine to check if two objects have collided. Controls which degrees of freedom are allowed for the simulation of this Rigidbody2D. Coefficient of drag. Controls whether physics will change the rotation of the object.