Unity Basics
  • Welcome
  • Getting Started with Unity Software
  • Helpful Shortcuts
  • The Unity Software Interface
    • The Default Interface
    • The Windows (Tabs)
      • Hierarchy Window
      • Scene Window
      • Project Window
      • Inspector Window
      • Game Window
      • Console Window
    • Other Layouts
      • Create a Custom Layout
  • Create
    • Creating Game Objects
      • 3D Primitives
      • Creating Game Objects in the Editor
      • Spawning Objects
      • Unhiding/Hiding Objects During Gameplay
      • Parenting
    • Creating Assets
    • Creating Components and Scripts
      • Adding Components in the Inspector
      • Creating Custom Components and Scripts
    • Creating Prefabs
  • Select and Update
    • General Selection
    • Search and Focus
    • Updating Game Objects
      • Updating Game Objects in the Editor
      • Updating Prefabs
    • Updating Assets
    • Updating Components
      • Update Components in the Inspector
      • Accessing Components Through Scripts
  • Delete
    • Deleting Game Objects
      • Deleting and Disabling Objects in the Editor
      • Using the Destroy() Function
    • Deleting Components and Scripts
      • Disabling and Removing Components in the Editor
      • Disabling and Removing Components During Gameplay
  • Translate, Rotate, and Scale
    • Intro to Transforms
    • Handy Transform Shortcuts
    • Translate
      • Positioning Game Objects in the Editor
      • Updating Position Through Script Code
      • Using the Transform.Translate() Function
    • Rotate
      • Rotating Game Objects in the Editor
      • Updating Rotation Through Script Code
      • Using the Transform.Rotate() Function
    • Scale
      • Resizing/Scaling Objects in the Editor
      • Updating Scale Through Script Code
    • Controlling Speed
    • Common Issues with Transforms
  • Materials
    • Material Basics
      • Creating and Applying Materials
      • Accessing Materials Through Code
  • Physics
    • Physics Basics
    • Colliders and Triggers
      • Collider Component Overview
      • Accessing Colliders Through Scripts
      • Common Issues: Colliders and Triggers
    • Rigidbody Component
      • Rigidbody Component Overview
      • Accessing the Rigidbody Component Through Scripts
      • Common Issues: Rigidbody Components
    • Common Issues: Physics and Velocity
  • Interaction
    • Interaction Basics
    • Keyboard Controls
    • Mouse Controls
  • Coding Basics
    • Intro to Scripts
    • Variables
    • Conditionals (If / Then / Else)
    • Arrays
    • Loops
    • Functions
Powered by GitBook
On this page
  • Default Rigidbody Component
  • Gravity
  • Is Kinematic
  • Constraints

Was this helpful?

  1. Physics
  2. Rigidbody Component

Rigidbody Component Overview

PreviousRigidbody ComponentNextAccessing the Rigidbody Component Through Scripts

Last updated 4 years ago

Was this helpful?

Default Rigidbody Component

Gravity

Here, you can use the mass and drag properties to say how heavy the object seems as it falls, slides, or floats. The more mass the object has, the more force it is required to move it and keep it moving and the more force it will appear to have when accelerated.

Gravity can be toggled for neat effects, but cannot be less than zero. If you want a "floating" effect for water, etc., consider using a script with Vector3.Lerp() where the destination position is a set height.

To see the gravity in action, click the Play button.

Any object or property added, updated, or removed will reset when you stop playing. Make sure to not make important changes in Play Mode.

Is Kinematic

When this is checked, collisions and forces in the scene will not affect the object's Rigidbody component. Why have one, then? Even with Kinematic turned on, force and other factors can be changed through scripts to have it fall and float with mass.

Constraints

Use these constraints where an object needs to be frozen on one or more axes from moving or rotating. This is helpful for objects you do not want to tip but needs a Rigidbody component. An example could be a player object that might run into something, but it should stay standing. Constraining the X and Z rotations will prevent the object from tipping, but it can be rotated to look and move around the room.