Beginning 3D Game Development with Unity 4: by Sue Blackman

Beginning 3D Game Development with Unity 4: by Sue Blackman

Author:Sue Blackman
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


2.Check Is Trigger on its Collider component.

3.Name it Rock Zone.

4.Scale the cube to about 2 × 2 × 3.

5.Disable the Mesh Renderer.

6.Create a new script in the Adventure Scripts folder.

7.Name it Rocks.

8.Open it in the script editor and copy and paste the sample code from the docs.

// Instantiates prefab when any rigid body enters the trigger.

// It preserves the prefab's original position and rotation.

var prefab : Transform;

function OnTriggerEnter () {

Instantiate (prefab);

}

9.Save the script.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.