playMaker

Author Topic: Explosion / Layer Mask Confusion [SOLVED]  (Read 660 times)

curb47

  • Sr. Member
  • ****
  • Posts: 256
Explosion / Layer Mask Confusion [SOLVED]
« on: February 02, 2021, 01:36:13 AM »
Hiya,

I hope you're all well. I'm confused. Story of my life.

I've got a bunch of enemy drones that are children of an object moving towards the Mothership. When you intercept them and started shooting them, they de-parent from the 'Move Towards' object and then target your player space ship.

When they de-parent they use rigidbody/look at/apply force physics to attack you.



So, at the moment the drones are de-parented, I want to add a moment of outward force so they spread out and then target your player spaceship.

I'm using the Explosion action, but I'm having problems setting the parameters on the Action. As there are no visualisations for the action I don't know if the Force should be 10 or 100, and the same for the Radius, like, what is the scale?

I can fiddle around with trial and error for Force/Radius, so that'll be okay, but the main misunderstanding I'm having is the Layer and Layer Mask settings.

I thought I should just have my Enemies on the Layer setting, but when I hover the cursor over Layer Mask, the little message pops up saying- Type: Int Array Layers to Effect, so I put it in there. I dunno.



At the moment, I'm not getting any result from the Explosion action, and I just wondered if somebody could please give me a push in the right direction, ie - tell me how to set it up?

Many thanks.

J.

« Last Edit: February 03, 2021, 02:42:54 AM by curb47 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Explosion / Layer Mask Confusion
« Reply #1 on: February 02, 2021, 06:09:00 PM »
Hi.
I looked to the code and it seems that layer is not used.

in layer mask you should set the layer that should be affected.

make sure that the layer is set on the object that has the rigidbody (and possible on the collider if its a child object)

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: Explosion / Layer Mask Confusion
« Reply #2 on: February 03, 2021, 02:42:40 AM »
Thanks djaydino,

I'm seeing some results, but it very tricky to get the right settings. sometimes they fly away really fast and for a great distance, then when I change the settings just a little bit, there's no effect at all.

Anyway, I'll figure it out. Thanks again.