Challenge 1: Basic Object Physics

Tutorial

·

Beginner

·

+10XP

·

30 mins

·

(100)

Unity Technologies

Challenge 1: Basic Object Physics

In this tutorial, learners will:

  • Simulate gravity and basic collider interactions in Unity.
  • Understand the difference between trigger colliders and non trigger colliders

Languages available:

1. Project Setup

The project relies on the Cinemachine package to assist in camera movements. To install the Cinemachine Package, Open the Package Manager (Window > Package Manager), search for and install the Cinemachine Package.

2. Configure the Small and Medium Spheres to use Gravity

1. Press play and notice the Sphere_Small GameObject remains stationary in the scene.

2. Select the Sphere_Small GameObject and in the Inspector click Add Component, search for and select the RigidBody component.

3. Press play in the scene. Notice how the sphere is now affected by gravity.

4. Select the Sphere_Medium GameObject and in the Inspector click Add Component, search for and Select the RigidBody component. Increase the mass to 10.

5. Press play and you should now see both sphere GameObjects affected by gravity.

6. To change the collision characteristics of the ramp, create a Physics Material by right clicking in the Project window, clicking create, and Physic Material. Name it “Ramp” or another name of your choosing.

7. Adjust the Physics Material properties as follows:

8. Apply the physics material to the ramp GameObject’s MeshCollider component.

9. Press play to see the sphere bounce on the surface of the ramp.

Complete this tutorial