x


inside a script is there a way to disconnect a child from its paretn in c#

i want to disconnect a rocket that is attached to a helicpter when it is fired , but it is connected in a hierarchy, so if a move the rocket and then move the helicpter , the rocket would still be attached, so how do i disconnect it within a script

more ▼

asked Jul 24 '12 at 03:28 PM

thedodgeruk gravatar image

thedodgeruk
92 8 24 49

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

1 answer: sort voted first

Just set the rockets transform.parent = null.

more ▼

answered Jul 24 '12 at 03:31 PM

whydoidoit gravatar image

whydoidoit
32.8k 11 23 98

cheers, not realise it was that simple , or were the code was , cheers

Jul 24 '12 at 03:46 PM thedodgeruk

No problem - please tick the question as answered :)

Jul 24 '12 at 05:45 PM whydoidoit
(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:

x3314
x418
x407
x147
x5

asked: Jul 24 '12 at 03:28 PM

Seen: 247 times

Last Updated: Jul 24 '12 at 05:45 PM