Introdcution to Physics in Unity

Kinga Osińska
2 min readApr 7, 2021

--

Today’s article is about physics engine in Unity.

Rigidbody

The Rigidbody component is what enables all the physics properties. By adding this component you can simulate the forces which exist in the real world, such as gravity, velocity, or mass of a GameObject.

For 3D GameObjects use Rigidbody component, for 2D GameObjects use Rigidbody2D.

isKinematic - controls whether physics affects the rigidbody.

Colliders

You can use collider component to detect collision between GameObjects.

To detect collision between GameObject, one of them must have a Rigidbody!

I will explain about colliders in the next article.

Physic Material

Thanks to physic material you can simulate friction and bouncing effect between colliding objects. You can simulate different physics materials, such as rubber, ice, mud, or a bouncy ball.

To add physic material go to Project panel -> Create ->Physic Material

Joint

This is a component that connects Rigidbody to another Rigidbody. There are different types of Physics Joints:

Character Joint - can simulate a character joint such as hip or shoulder joint.

Fixed Joint - great for connecting to Rigidbodies without parenting in a Transform hierarchy.

Hinge Joint - can simulate opening doors

Spring Joint - simulates connecting two Rigidbodies as though they are connected by a spring

Configurable Joint - using only this component you can simulate all the joints with better control

--

--