0
0
Unityframework~30 mins

Rigidbody forces and velocity in Unity - Mini Project: Build & Apply

Choose your learning style9 modes available
Rigidbody forces and velocity
📖 Scenario: You are creating a simple Unity game where a ball moves when forces are applied. You want to control the ball's movement using Rigidbody physics.
🎯 Goal: Build a Unity script that applies a force to a Rigidbody and then reads its velocity to display how fast the ball is moving.
📋 What You'll Learn
Create a Rigidbody variable and assign it in the script
Create a Vector3 force variable with exact values
Apply the force to the Rigidbody using AddForce
Read the Rigidbody's velocity and print it
💡 Why This Matters
🌍 Real World
In many games, objects move realistically using physics forces and velocities. This project shows how to control and monitor that movement.
💼 Career
Understanding Rigidbody forces and velocity is essential for game developers working with Unity to create smooth and realistic object movements.
Progress0 / 4 steps
1
Create a Rigidbody variable
Declare a public variable called rb of type Rigidbody inside the class.
Unity
Need a hint?

Use public Rigidbody rb; inside the class but outside any method.

2
Create a force vector
Create a private variable called force of type Vector3 and set it to new Vector3(0, 300, 0) inside the class but outside any method.
Unity
Need a hint?

Use private Vector3 force = new Vector3(0, 300, 0); inside the class.

3
Apply force to the Rigidbody
Inside the Start() method, apply the force to rb using rb.AddForce(force);.
Unity
Need a hint?

Write a Start() method and call rb.AddForce(force); inside it.

4
Print the Rigidbody velocity
Inside the Update() method, print the velocity of rb using Debug.Log(rb.velocity);.
Unity
Need a hint?

Use Debug.Log(rb.velocity); inside the Update() method to see the velocity in the console.