This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnCollisionEnter (myCollision : Collision) { | |
if(myCollision.gameObject.name == "Floor"){ | |
var myLight : Light = gameObject.Find("Light").GetComponent(Light); | |
myLight.enabled = true; | |
myLight.intensity = 5; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnCollisionEnter (myCollision : Collision) { | |
if(myCollision.gameObject.name == "Floor"){ | |
Application.LoadLevel(myLevel); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnCollisionEnter (myCollision : Collision) { | |
if(myCollision.gameObject.name == "Platform"){ | |
if(!myCollision.gameObject.rigidbody){ | |
myCollision.gameObject.AddComponent(Rigidbody); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update () { | |
Counter++; | |
guiText.text = "Counter is: "+Counter; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(myTrigger.gameObject.name == "box"){ | |
Debug.Log("Box went through!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update () { | |
var horiz : float = Input.GetAxis("Horizontal"); | |
transform.Translate(Vector3(horiz,0,0)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No Script, just a thing for establishing joints and whatnot. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Using Play One Shot | |
var myClip : AudioClip; | |
function Start () { | |
audio.PlayOneShot(myClip); | |
//Using Play Clip at point | |
var myClip : AudioClip; | |
function Start () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's no script for this really. | |
Just select your object and change the element below the mesh renderer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var power : float = 500.0; | |
function Start () { | |
rigidbody.AddForce(Vector3(0,0,power)); | |
} |