Skip to main content
Cleanup
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Unity: how How to detect collision occuringoccurring on a child object, from a parent script?

I'veI have an enemy, with this structure:

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And...and so on.

  I also have a collider for each part of the body. In

In my "Enemy" object I've attached a script, and in that script I would like to intercept possible collisioncollisions (afrom a bullet) forhitting the body, head, arm, left etc.

Is there a wayHow can I to do this?

Unity: how to detect collision occuring on child object, from a parent script?

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And so on.

  I also have a collider for each part of the body. In my "Enemy" object I've attached a script and in that script I would like to intercept possible collision (a bullet) for body, head, arm, left etc.

Is there a way to do this?

How to detect collision occurring on a child object, from a parent script?

I have an enemy with this structure:

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

...and so on. I also have a collider for each part of the body.

In my "Enemy" object I've attached a script, and in that script I would like to intercept possible collisions (from a bullet) hitting the body, head, arm, left etc.

How can I to do this?

Question Protected by Vaillancourt
Corrected grammar
Source Link
user35344
user35344

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And so on.

I also have a collider for each part of the body. In my "Enemy" object i'veI've attached a script and in that script iI would like to intercept possible collision (a bullet) for body,head head,arm arm, left etc..

Is there a way to do this?

Thanks everyone for the help.

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And so on.

I also have a collider for each part of the body. In my "Enemy" object i've attached a script and in that script i would like to intercept possible collision (a bullet) for body,head,arm left etc..

Is there a way to do this?

Thanks everyone for the help.

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And so on.

I also have a collider for each part of the body. In my "Enemy" object I've attached a script and in that script I would like to intercept possible collision (a bullet) for body, head, arm, left etc.

Is there a way to do this?

Corrected grammar
Source Link

Good day.

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

EtcAnd so on.

I'veI also have a collider for each part of the body. In my "Enemy" object i've attached a script and in that script i would like to intercept possible collision (a bullet) for body,head,arm left etc..

HowIs there a way to do this?

Thanks everyone for the help.

Good day.

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

Etc.

I've a collider for each part of the body. In my "Enemy" object i've attached a script and in that script i would like to intercept possible collision (a bullet) for body,head,arm left etc

How to do ?

Thanks

I've an enemy, with this structure

  • Enemy
    • Body
      • Head
      • Arm Left
      • Arm right

And so on.

I also have a collider for each part of the body. In my "Enemy" object i've attached a script and in that script i would like to intercept possible collision (a bullet) for body,head,arm left etc..

Is there a way to do this?

Thanks everyone for the help.

Tweeted twitter.com/StackGameDev/status/937321464679796736
Source Link
stighy
  • 477
  • 6
  • 32
  • 62
Loading