Gamebridge/Coin Tutorial: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
Lxpk (talk | contribs)
Created page with "= Coin Tutorial = == Once you've made your first level have obstacles to avoid falling forever, it's time to add some objectives for your players to seek out. == * Create a ..."
 
Lxpk (talk | contribs)
No edit summary
Line 7: Line 7:
* Make Coin.cs a trigger that sends an AddCoin message to World.cs
* Make Coin.cs a trigger that sends an AddCoin message to World.cs
* Make World.cs increment a coin integer variable and display it OnGUI.
* Make World.cs increment a coin integer variable and display it OnGUI.
== Make a coin object ==
You need an actual 3D game object to represent coins in the game.
# In the Hierarchy panel, click Create.
# Click 3D Object.
# Click Cylinder.
=== Size the cylinder to look like a coin ==
# Click the Scale tool or press the R key.
# Double click on the cylinder's name in the Hierarchy or type F key to focus on the cylinder, which zooms into it
# In the inspector panel, the scale's Y value defaults to 1. Set it to be 0.1.
# Now it looks like a flat, circular coin, a doubloon!
=== Color the coin to be golden ===
* Attach the Coin.cs script to

Revision as of 23:35, 10 November 2015

Coin Tutorial

Once you've made your first level have obstacles to avoid falling forever, it's time to add some objectives for your players to seek out.

  • Create a Coin.cs script
  • Create a World.cs script
  • Make Coin.cs a trigger that sends an AddCoin message to World.cs
  • Make World.cs increment a coin integer variable and display it OnGUI.

Make a coin object

You need an actual 3D game object to represent coins in the game.

  1. In the Hierarchy panel, click Create.
  2. Click 3D Object.
  3. Click Cylinder.

= Size the cylinder to look like a coin

  1. Click the Scale tool or press the R key.
  2. Double click on the cylinder's name in the Hierarchy or type F key to focus on the cylinder, which zooms into it
  3. In the inspector panel, the scale's Y value defaults to 1. Set it to be 0.1.
  4. Now it looks like a flat, circular coin, a doubloon!

Color the coin to be golden

  • Attach the Coin.cs script to