0
0
Unityframework~30 mins

Rigidbody 3D component in Unity - Mini Project: Build & Apply

Choose your learning style9 modes available
Rigidbody 3D Component Basics
📖 Scenario: You are creating a simple 3D game scene in Unity where a ball falls and bounces on a platform using physics.
🎯 Goal: Learn how to add and configure a Rigidbody 3D component to a GameObject to make it respond to gravity and physics forces.
📋 What You'll Learn
Create a GameObject representing a ball
Add a Rigidbody 3D component to the ball
Set the Rigidbody to use gravity
Print the ball's velocity in the console
💡 Why This Matters
🌍 Real World
Physics-based movement and interaction are common in games and simulations to create realistic behaviors.
💼 Career
Understanding Rigidbody components is essential for game developers working with Unity to build interactive 3D environments.
Progress0 / 4 steps
1
Create a GameObject called ball
Write a line of code to create a new GameObject called ball.
Unity
Need a hint?

Use new GameObject("ball") to create the object.

2
Add a Rigidbody component to ball
Add a Rigidbody component to the ball GameObject using ball.AddComponent<Rigidbody>().
Unity
Need a hint?

Use AddComponent<Rigidbody>() on the ball object.

3
Enable gravity on the Rigidbody
Set the useGravity property of the Rigidbody rb to true.
Unity
Need a hint?

Set rb.useGravity = true; to enable gravity.

4
Print the Rigidbody velocity
Write a line to print the current velocity of the Rigidbody rb using Debug.Log(rb.velocity);.
Unity
Need a hint?

Use Debug.Log(rb.velocity); to print velocity.