How To Make A Basketball in Unity with Materials and Textures? 🏀

Rajat Kumar Gupta
3 min readJul 2, 2021

Overview

· Overview
·
Pre-requisites
·
Step 1: Create a folder that contains all the textures
·
Step 2: Download a texture
·
Step 3: Drop the texture into your Unity project
·
Step 4: Apply the downloaded texture to the sphere
·
Step 5: Make your basketball bounce

In this article, you will learn how to make a basketball using Materials and Textures in Unity. This microconcept can be extended to create any kind of ball i.e football, tennis ball, snooker balls. That said, it is not just limited to creating balls. You should be able to use this concept to customize the look of any type of geometry(or mesh).

Here is what you will create👇🏻

A basketball bouncing on a plane surface
Basketball🏀

Think of the basketball as a sphere wrapped around with a pretty paper.

Let’s get started.

Pre-requisites

Your sample scene should have —

  1. A plane
  2. A sphere with a custom material

This tutorial is based on the techniques mentioned in an earlier one👇🏻.

Step 1: Create a folder that contains all the textures

To keep things organized, let’s create a folder that will contain all the textures.

Right-click in Assets Panel > Create > Folder > Name it “Textures”
Right-click in Assets Panel > Create > Folder > Name it “Textures”

Step 2: Download a texture

Since we need a texture for a basketball, simply download one online. A texture is just an image in .png or .jpg format. For now, you can download the basketball texture from here.

P.S — Make sure you have the appropriate license to use a texture that you download. The above ones are free to use.

Step 3: Drop the texture into your Unity project

Drag and drop the downloaded texture into the “Textures” folder that you created in Step 1 above.
Drag and drop the downloaded texture into the “Textures” folder that you created in Step 1 above.

Step 4: Apply the downloaded texture to the sphere

It is important that your sphere has a custom material in this step. Otherwise, you will not be able to view or modify the various properties of the Material.

Drag and drop the downloaded texture to the box at the left of the Albedo property.

Step 5: Make your basketball bounce

You can do this by following this tutorial that I wrote earlier👇🏻

That’s it!🎉

You successfully used Materials and Textures to create a basketball. Now, you can do the same for all your games or AR/VR experiences that you develop.

Different types of balls behave differently. Try experimenting around with the bounciness and tweaking the different parameters of the Rigid Body Component attached to the sphere to create a golf ball, a football, or a tennis ball.

Enjoy!👏🏻

This article was also published in FreeCodeCamp.

--

--