playMaker

Author Topic: CollisionEvent should default to detecting ALL collisions  (Read 3598 times)

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
CollisionEvent should default to detecting ALL collisions
« on: June 04, 2013, 10:16:02 PM »
When using straight Unity scripting, the default function is "function OnCollisionEnter (hit:Collision)". There is no need to compare to a tag and by default it will return the collider of anything it hits.

With the CollisionEvent action, you are forced to choose either:
Untagged, which only fires on objects with no tag at all on them.
A specific tag: meaning it will only check for objects with one single specific tag.
Or "none", which doesn't seem to check anything at all and never fires.

By default this action should always return a collider and fire off the send event and only get more specific if the scripter changes the default setup. Either the behavior of "none" needs to be changed to mean "don't check for a specific collider, just always return whatever is hit" or there needs to be an additional tag labeled "All" that checks for all collisions, tagged or not.

The current way "none" is set up makes no sense: if the action will never fire, then what's the point of it being there? If "none" is just a standard field that's on all actions that can't be changed, then an "All" option would be the better default choice, since it's most self-explanatory and most mimics default Unity scripting.

I thought I was going nuts or had screwed something up when I figured out my projectiles had all suddenly stopped working, then I realized I had recently converted them from straight scripting to Playmaker and hadn't really tested much.

Note: MaDDoX make an updated version of this action way back in 2011 which adds the ability to check for multiple tags. I'm surprised this hasn't been integrated into the mainline yet. It still doesn't, however, address the need for a check for "All" colliders.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: CollisionEvent should default to detecting ALL collisions
« Reply #1 on: June 06, 2013, 01:40:22 AM »
Hi,

 I might not follow properly, but given your explanations, simply add a "ON COLLISION ENTER" as a transition of your state, not as a global transition, then you don't need the action itself and then user Get collision info action. That works fine for all my needs.

I do agree tho on the "none" issue where it could be more explicit.

bye,

 Jean

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
Re: CollisionEvent should default to detecting ALL collisions
« Reply #2 on: June 06, 2013, 02:34:11 AM »
Unfortunately, there are a lot of instances where that won't work because the ON COLLISION ENTER is always checking for collisions. There isn't a way to turn it on and off easily. This messes with a lot of the logic, like only checking for certain collisions once certain preparations are made or conditions set. Otherwise, states are being fired off when they shouldn't be.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: CollisionEvent should default to detecting ALL collisions
« Reply #3 on: June 06, 2013, 02:55:02 AM »
Hi,

 I see what you mean now.

Can you try the actions attached? if they are suitable, I'll make them available in the custom actions section of the forum.

 basically, "none" is now understood, so if you set the collider tag to none, it will catch all.


bye,

 

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
Re: CollisionEvent should default to detecting ALL collisions
« Reply #4 on: June 06, 2013, 12:58:33 PM »
tested: those two work fine. Thanks :)

Have you read my other post about CollisionEvent not working on prefabs with multiple colliders here?:

http://hutonggames.com/playmakerforum/index.php?topic=4078.0

I probably should have just reported it as a bug too, but I hate doing that too often when I'm new at something and don't necessarily know what's going on. Sorry if I'm causing more work for you.

And just to make things even more interesting, have you looked at adding support for multiple tags as MaDDoX did here>:

http://hutonggames.com/playmakerforum/index.php?topic=4078.0

The script seems to work pretty well. This last one isn't a bug, but I just thought if you had to rework the script again anyway, it might be nice to incorporate this functionality in with the rest of it.

Anyway, thanks again for all the support. You've definitely got the fastest response time of anyone I've ever worked with!