- Home /
How put Halo in Script?
I need put Halo in my Script.
Which librarys I need ?
And i need when my Sphere collision with my block ( "cube" or " cube(clone)" ) halo's block is activated.
The good code is this? :
Halo thisMono = GetComponent();
thisMono.enabled = true;
////////////////////////////////////// SCRIPT //////////////////////////////////////////////
public class Colision : MonoBehaviour {
void OnCollisionEnter(Collision col){
// GameObject halo = Instantiate(HaloPrefab) as GameObject;
if ( col.gameObject.name == "Cube") {
// Destroy (col.gameObject);
//halo.transform.SetParent (transform, false);
col.gameObject.SetActive(false);
}
if ( col.gameObject.name == "Cube(Clone)") {
// Destroy (col.gameObject);
col.gameObject.SetActive(false);
}
if (col.gameObject.name == "Cube1(Clone)") {
// Destroy (col.gameObject);
col.gameObject.SetActive (false);
}
if ( col.gameObject.name == "Cube2(Clone)") {
// Destroy (col.gameObject);
col.gameObject.SetActive(false);
}
if ( col.gameObject.name == "Cube3(Clone)") {
// Destroy (col.gameObject);
col.gameObject.SetActive(false);
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Errors appearing from codes of Unity Libraries 0 Answers
Visual Studio - Missing "GameAssembly.lib" 1 Answer
Unity supports Microsoft_Office_Interop_Word? 0 Answers
Problem iOS compile -library not found? 0 Answers
Unity 5.3.1 MonoDevelop Library Problem 0 Answers