Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1.     public GameObject rep;
  2.     public GameObject noviDel;
  3.     public GameObject zadniDel;
  4.  
  5.     public float stevec = 0;
  6.  
  7.     void  Dodaj (){
  8.         if(zadniDel == null)
  9.             zadniDel = gameObject;
  10.        
  11.         noviDel = (GameObject)Instantiate(rep, zadniDel.transform.position - zadniDel.transform.forward, new Quaternion(0,0,0,0));
  12.         zadniDel.transform.rotation = zadniDel.transform.rotation;
  13.         new HingeJoint joint = (GameObject)zadniDel.GetComponent(HingeJoint);
  14.         if(joint != null) {
  15.             joint.connectedBody = zadniDel.rigidbody;
  16.             zadniDel = noviDel;
  17.         }
  18.         noviDel.name = "rep1 " + stevec;
  19.         stevec++;
  20.        
  21.         rigidbody.mass++;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement