Question by
nnk1021 · Dec 02, 2015 at 02:46 AM ·
transformtransform.parent
what object does the parent child code go on?
I cant figure out what to attach the parent child code to. The code that allows an object to be locked together with another. so would the code go on the Parent object or the child or the world? where?
Comment
Answer by toddisarockstar · Dec 02, 2015 at 03:10 AM
im not sure exactly what your asking. if you want a code to simply attach two objects it can be done like this in anycode from anywhere.
var par:GameObject;
var chi:GameObject;
par = gameObject.Find("whateveryounamedparent");
chi = gameObject.Find("whateveryounamedchild");
chi.transform.parent=par.transform;
Your answer
Follow this Question
Related Questions
How to enable vertical movement in certain areas only 2d 1 Answer
Why this isn't working? 1 Answer
Cannot properly access player position 1 Answer