Creating a spot for the cherry

The following steps demonstrate how to create a spot for the cherry on the Cucumber Man's right hand.

  1. In the Hierarchy panel, expand the CucumberMan object until you see Character1_RightHand.
  2. Right-click Character1_RightHand and select Create Empty.
  3. Rename the new GameObject to cherrySpot. This will be the spot where we render the cherry.

Your CucumberMan object's hierarchy should look as follows:

  1. Using the transform tools, move the cherrySpot GameObject so that it is inside the Cucumber Man's right hand. Your placement should be similar to what is displayed here:

We will need to add a Rigidbody to the Cherry prefab so we can instantiate and throw it during runtime.

  1. In the Project panel, select Assets | Cherry | Cherry.Prefab
  2. In the Inspector panel, click the Add Component button
  3. Select Physics | Rigidbody
  4. Uncheck the Use Gravity option
  5. Expand the Constraints section of the Rigidbody component
  6. Check all Freeze Position and Freeze Rotation boxes

Next, we will add the Cherry prefab to our scene.

  1. Drag the Cherry prefab from the Project panel to the Hierarchy panel, making it subordinate to the cherrySpot game object.
  2. In Scene view, zoom in and adjust the location of the cherrySpot so the cherry looks as if the Cucumber Man is holding it. A suggested placement is shown here:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset