|
How to make a Music Game - Java Code - Delete_Note
[Back]
Code:
#pragma strict
function Update()
{
transform.position.x = -0.06792158; //Set object x position
transform.position.y = -5.977774; //Set object y position
transform.position.z = 0; //Set object z position
transform.rotation.x = 0; //Set object x position
transform.rotation.y = 0; //Set object y position
transform.rotation.z = 0; //Set object z position
}
function OnCollisionEnter2D(other : Collision2D)
{
if(other.gameObject.tag == "Note")
{
Destroy(other.gameObject);
}
}
function Update()
{
transform.position.x = -0.06792158; //Set object x position
transform.position.y = -5.977774; //Set object y position
transform.position.z = 0; //Set object z position
transform.rotation.x = 0; //Set object x position
transform.rotation.y = 0; //Set object y position
transform.rotation.z = 0; //Set object z position
}
function OnCollisionEnter2D(other : Collision2D)
{
if(other.gameObject.tag == "Note")
{
Destroy(other.gameObject);
}
}