Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: KoneJone 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.)
-
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?
-
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? ;)
-
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
-
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.
-
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
-
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:
collideTag = new FsmString() { UseVariable = true };
OnReset() after 1.8.x:
collideTag = "Untagged";
Collision/Trigger events before:
if (collisionInfo.collider.gameObject.tag == collideTag.Value || collideTag.IsNone || string.IsNullOrEmpty(collideTag.Value))
Collision/Trigger events after 1.8.x:
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.
-
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