Advertisement
Guest User

bulletmovement

a guest
Dec 11th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. public void OnCollisionEnter(Collision col)
  2.     {
  3.         if (col.gameObject.tag == "plat")
  4.         {
  5.             GameObject.Find("player/Camera/senjata").GetComponent<senjata>().jml_peluru -= 1;
  6.             col.gameObject.GetComponent<ScriptBalok>().Moved = !col.gameObject.GetComponent<ScriptBalok>().Moved;
  7.             if (col.gameObject.GetComponent<ScriptBalok>().Back == true)
  8.             {
  9.  
  10.                 GameObject.Find("player/Camera/senjata").GetComponent<senjata>().jml_peluru += 2;
  11.             }
  12.  
  13.             Destroy(gameObject);
  14.         }
  15.        
  16.  
  17.         if (col.gameObject.tag == "Wall")
  18.         {
  19.            
  20.             Destroy(gameObject);
  21.         }
  22.  
  23.         if (col.gameObject.tag == "floor")
  24.         {
  25.            
  26.             Destroy(gameObject);
  27.            
  28.         }
  29.  
  30.         if (col.gameObject.tag == "death floor")
  31.         {
  32.  
  33.             Destroy(gameObject);
  34.  
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement