Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public GameObject rep;
- public GameObject noviDel;
- public GameObject zadniDel;
- public float stevec = 0;
- void Dodaj (){
- if(zadniDel == null)
- zadniDel = gameObject;
- noviDel = (GameObject)Instantiate(rep, zadniDel.transform.position - zadniDel.transform.forward, new Quaternion(0,0,0,0));
- zadniDel.transform.rotation = zadniDel.transform.rotation;
- new HingeJoint joint = (GameObject)zadniDel.GetComponent(HingeJoint);
- if(joint != null) {
- joint.connectedBody = zadniDel.rigidbody;
- zadniDel = noviDel;
- }
- noviDel.name = "rep1 " + stevec;
- stevec++;
- rigidbody.mass++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement