x


Before updating to Windows 10 you may need to return your Pro license. More information here

Dynamically parent gameobjects

How do you dynamically parent gameobject at runtime?

more ▼

asked Mar 15, 2011 at 07:45 AM

avatar image

ina
5.2k 1646 1293 1346

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You need to use the parent property on the transform:

transform.parent = anotherTransform;
more ▼

answered Mar 15, 2011 at 07:49 AM

avatar image

Mike 3
34.6k 28 156 319

How do you reference a dynamically created object though

Mar 15, 2011 at 07:59 PM ina

var instantiated = Instantiate(prefab) as GameObject; transform.parent = instantiated.transform;

Mar 15, 2011 at 08:31 PM Mike 3
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4330
x810
x738
x290

asked: Mar 15, 2011 at 07:45 AM

Seen: 6436 times

Last Updated: Mar 15, 2011 at 07:45 AM