playMaker

Author Topic: Collision2D Event in Playmaker 1.8.1  (Read 3413 times)

KoneJone

  • Playmaker Newbie
  • *
  • Posts: 20
    • Planet Jone
Collision2D Event in Playmaker 1.8.1
« on: June 13, 2016, 01:24:37 PM »
Did Collision2D Event change with Playmaker 1.8.1?

I used it in a couple of places in the gane with "Collide Tag" parameter left empty to let everybody collide with the object and just "Store Collider" to decide what to do next.

It seems that in 1.8.1 the Collision2D Event doesn't fire at all anymore, if the "Collide Tag" is left empty. (But works if I add a specific tag.)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Collision2D Event in Playmaker 1.8.1
« Reply #1 on: June 13, 2016, 01:39:08 PM »
I don't think so, at least not intentionally. We have integration tests with Collision2D Event and Untagged that pass, so this should work...

Can you repro in a simple scenario?

KoneJone

  • Playmaker Newbie
  • *
  • Posts: 20
    • Planet Jone
Re: Collision2D Event in Playmaker 1.8.1
« Reply #2 on: June 13, 2016, 02:57:13 PM »
Hmm - Untagged I think selects objects without a tag, whereas I used the "None" (empty) to tell the action to work with any object with any tag?

EDIT: To leave the Collide Tag empty, I used the "Use Variable" button and chose "None". That might be a misuse of the action? ;)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Collision2D Event in Playmaker 1.8.1
« Reply #3 on: June 14, 2016, 02:57:49 AM »
Hi,

 This is the typical issue with tags.

"Untagged" IS a tag...

So yes, you found out the hard way, that if you don't want any tag, you need to set the variable to "none".

It got me several times too...

Bye,

 Jean

KoneJone

  • Playmaker Newbie
  • *
  • Posts: 20
    • Planet Jone
Re: Collision2D Event in Playmaker 1.8.1
« Reply #4 on: June 14, 2016, 04:53:00 AM »
Ok, thanks!

Just in case, to be clear: I think the functionality of the Collision2D Event action changed in 1.8.1 so that it doesn't fire anymore if the variable is set to "none", though it did do that in the previous version of the action.

I can re-check this next time I'm at my computer.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Collision2D Event in Playmaker 1.8.1
« Reply #5 on: June 16, 2016, 03:22:20 AM »
Hi,

 Possibly yes. I recall the time when we detected this issue.

Also, all 2d stuff got implemented official in PlayMaker with 1.8, not before. so are you saying it worked differently in 1.8.0? or before 1.8?

 Bye,

 Jean

TeamCherry

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Collision2D Event in Playmaker 1.8.1
« Reply #6 on: November 22, 2016, 12:14:53 AM »
I can confirm that this did in fact change, we recently migrated from 1.7.x to 1.8.3 and this also tripped us over. Collision2DEvent and Trigger2DEvent actions both changed the way their default values are set and reset as well as what they do with the tags.

OnReset() before:
Code: [Select]
collideTag = new FsmString() { UseVariable = true };
OnReset() after 1.8.x:
Code: [Select]
collideTag = "Untagged";
Collision/Trigger events before:
Code: [Select]
if (collisionInfo.collider.gameObject.tag == collideTag.Value || collideTag.IsNone || string.IsNullOrEmpty(collideTag.Value))
Collision/Trigger events after 1.8.x:
Code: [Select]
if (collisionInfo.collider.gameObject.tag == collideTag.Value)
This caused all of our gameobjects using these actions to stop functioning correctly and without error. Because we literally have several hundred objects using these it would take too long to manually correct them so I changed the code in these scripts back to something like their earlier versions.

For anyone who finds this later on you can either update the code or roll back these actions to the earlier versions and you will restore their function and settings. There may also be other actions that use this same behaviour looking for tags.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Collision2D Event in Playmaker 1.8.1
« Reply #7 on: November 22, 2016, 12:57:14 AM »
Hi,

 yes, this situation with "untagged" and none is tricky indeed.

I would suggest taking the time to refactor as you'll have to do this on every PlayMaker update.

 Bye,

 Jean