Unity Dev: Player Prototype Cube

Alex Somerville
2 min readMar 18, 2021

Every game needs a protagonist avatar to carry out the always entirely altruistic motivations of the player. Because we want to get something up and running quickly, let’s just make a placeholder for our avatar.

Basic Setup

Right clicking in your Hierarchy window, 3D Object > Cube is more than enough to create our central protagonist. Let’s call him Cubert.

Wait… no… nevermind that.

Contrary to my GIF, you’ll want to rename your “Cube” object to “Player” for easy reference. Click on “Cube” in your hierarchy and change the name in the inspector to “Player”. While you’re here, select the “Tag” dropdown and set this object to the “Player” tag. Now we’ll have an easy way to reference it in our code.

If you want, you can spice up your cube with some colour easily enough.

  1. Right click in your Assets folder (in your Project window within Unity)
  2. Create a new folder called “Materials”. We want to keep all of our assets nice and organized for easy reference.
  3. Inside of “Materials”, right-click, Create > Material
  4. You can call it whatever you like, but since this will be applied to the player, let’s call it “Player_mat”.
  5. Look for the option called “Albedo” in the Inspector and use the colour picker to choose your favourite colour.
  6. Once completed, drag the “Player_mat” object from the Project window on top of the “Player” object inside of your Hierarchy window.

Nice! We have a personalized Hero Cube ready for action. In my next article, we’ll dip into how to get ol’ Cubo moving around at our behest.

--

--

Alex Somerville

On a quest to become a game developer. Still sometimes providing unsolicited advice about how to function in society.