Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: wheretheidivides on April 05, 2015, 12:19:21 AM

Title: How do you destroy 2 box colliders on same game object?
Post by: wheretheidivides on April 05, 2015, 12:19:21 AM
So I have a tank that has 2 or more box colliders on it.  I want to be able to use the tank without the colliders for menus.  I tried the action 'destroy component' but it only destroys 1.  if I try to do multiple ones, it only destroys the first one.  the component name I am using is 'BoxCollider'.  This is a prefab that gets instantiated in the hierarchy though a variable.

So is there a way to tell the colliders apart?  Maybe different names or something?
Title: Re: How do you destroy 2 box colliders on same game object?
Post by: TheBadFeeling on April 05, 2015, 07:08:20 AM
You're right, it'll only grab the first one and disregard the second, unless they are different types (Box/Sphere/etc).

But -- if you can point at them directly (like dragging the individual colliders into the State and choosing Set Property), it seems disable works fine.

Hope that could be of use.
/Bad
Title: Re: How do you destroy 2 box colliders on same game object?
Post by: wheretheidivides on April 05, 2015, 11:52:57 AM
I can't point at it because I instantiate a copy via a prefab.  All I have is a game object variable.  Right now my only workaround is before I instantiate the copy, I turn off the prefabs colliders.  When the scene is over I turn them back on.  Not ideal.