Course contentsShow
← Unity Game Development
Lesson 151 of 8283. Physics and InteractionFree lesson

Implementing Kinematic Bodies for Controlled Movement

You will learn to use kinematic rigidbodies to move objects via script while still allowing them to influence other physical colliders.

In this lesson, you will learn how to use kinematic Rigidbody components to move objects with absolute precision via script while maintaining physical interactions with other colliders.

What is a Kinematic Body?

Usually, a Rigidbody is "dynamic," meaning Unity’s physics engine calculates its movement based on forces, gravity, and collisions. However, a Kinematic Rigidbody ignores these external forces. Instead, you take full control of its position and rotation through your scripts.

While the object no longer falls or gets pushed by explosions, it remains a physical participant in the scene. Other dynamic objects will still collide with it, and it can trigger collision events or overlap triggers. This makes kinematic bodies perfect for objects like moving platforms, swinging pendulums, or player-controlled elevators that need to exert force on their surroundings without being pushed off course.

Implementing Movement

To set this up, simply check the Is Kinematic box on your Rigidbody component. When moving a kinematic body, you should modify its Transform or use Rigidbody.MovePosition. Modifying the position directly is the most common way to move them:

public class PlatformMover : MonoBehaviour
{
    public float speed = 2.0f;

    void FixedUpdate()
    {
        // Moving the kinematic body manually
        Vector3 newPosition = transform.position + transform.right * speed * Time.deltaTime;
        GetComponent<Rigidbody>().MovePosition(newPosition);
    }
}

Why use MovePosition?

While you could just change transform.position, using Rigidbody.MovePosition inside FixedUpdate is the preferred approach for kinematic objects. It tells the physics engine that the object is being moved, allowing the physics system to calculate collisions and friction between your kinematic body and dynamic objects (like a player character standing on top of your platform) more accurately. This ensures that the dynamic object is carried along naturally by the moving kinematic body rather than slipping off due to jitter or interpolation errors.

Key Takeaway: A kinematic Rigidbody allows you to manually control an object's movement via script while still allowing it to physically interact with and influence other colliders in your scene.