Skip to content

Rigidbody and movement

↑

Rigidbody makes an object participate in Unity’s 3D physics simulation. Use the 2D counterpart Rigidbody2D for 2D physics, which has separate APIs and callbacks. The right movement method depends on whether the object is dynamic, kinematic, or completely nonphysical.

Task Typical choice Why
Push a dynamic object AddForce Lets the physics solver handle acceleration
Control a dynamic body’s velocity Rigidbody velocity API Maintains predictable speed when used intentionally
Move a kinematic body MovePosition Cooperates with physics movement
Move a decorative nonphysical object Transform No Rigidbody solver needed
Unity C# | PushObject.cs
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public sealed class PushObject : MonoBehaviour
{
[SerializeField] private float acceleration = 6f;
private Rigidbody body;
private void Awake() => body = GetComponent<Rigidbody>();
private void FixedUpdate() => body.AddForce(Vector3.forward * acceleration, ForceMode.Acceleration);
}

ForceMode.Acceleration applies acceleration independently of mass. ForceMode.Force takes mass into account, while impulse modes represent instantaneous changes. Choose the mode based on the effect you want rather than adjusting numbers until it feels plausible.

  1. Do not teleport a dynamic body every frame using transform.position and still expect ordinary collision handling to behave exactly like physics-driven motion.
  2. Use the correct timing. Apply forces from FixedUpdate; read player input from Update or Input System callbacks.
  3. Check collision layers and colliders. A Rigidbody alone does not guarantee the desired collisions.
  4. Consider interpolation. A camera can see jitter when graphics update more frequently than physics.

Read the script lifecycle to see why the timing matters.