x


Parent/child, but not physics - wise?

Say you have an object "holder"

And then you have a dozen say "insects" that are all children of "holder"

Imagine the insects are all perhaps moving along at different velocities in different directions.

No problem BUT ... say you actually do NOT want the Insects to be children "in terms of physics"

In the situation I describe, if you for example rotate or move "holder" then, all the insects' paths will twist, they will move collectively etc.

Of course, you could just make each Insect simply NOT a child of Holder.

But it's convenient to be able to, say, eliminate them all at once, etc etc, as you can do of course if they are all the child of holder.

So I'm trying to make sort of "independent" children of Holder! heh. Every parents' dream

Am I forgetting something obvious, is there a way to perhaps "group" the Insects with no physics relationship, basically use the parent/child relationship with everything except the physics chain.

Any ideas, thanks ?!!

more ▼

asked Jul 13 '12 at 04:03 PM

Fattie gravatar image

Fattie
19.1k 58 87 148

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

2 answers: sort voted first

Well, as far as I understand what you're trying to do, a tag should work. You can remove all insects with the same tag with a single line of script:

Destroy (GameObject.FindWithTag ("Unit"));
more ▼

answered Jul 13 '12 at 06:32 PM

michielbos gravatar image

michielbos
51 2

I guess that's a good idea, thanks.

Similarly you could de-activate them, or whatever.

Still, it would be nice if you could just turn on and off "physics parenting".

Jul 13 '12 at 06:37 PM Fattie
(comments are locked)
10|3000 characters needed characters left

But do you actually need to do anything? If you have a empty gameobject as the parent, then nothing will move it except a script. Thus if you don't move it from a script you shouldn't have anything to worry about? or am I mistaken?

more ▼

answered Jul 13 '12 at 06:15 PM

Pelajesh gravatar image

Pelajesh
17 1 2 4

probably best to make this a comment rather than an answer, to keep the board tidy ! Just click "delete" and then click "comment"

1) there's nothing to worry about. this is true at all times! :)

2) there are any number of reasons you may need to re-align or move, etc, the Holder

3) when you do that, typically you want to also move, etc, the group of Insects in question. BUT there are many situations where you want the Insects to NOT move/etc, when you do what I said in the previous sentence.

Jul 13 '12 at 06:21 PM Fattie
(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:

x1880
x1797
x426

asked: Jul 13 '12 at 04:03 PM

Seen: 325 times

Last Updated: Jul 13 '12 at 06:37 PM