playMaker

Author Topic: [SOLVED]Trigger 2D Event ignoring Collide Tag  (Read 6121 times)

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
[SOLVED]Trigger 2D Event ignoring Collide Tag
« on: August 04, 2014, 12:32:45 PM »
Hi,

We're trying to make a door open when the hero walks into it, and that works just fine.  Unfortunately, it also opens when shot by a blaster.  We set the Collide Tag in the Trigger 2D Event to "Player", which is the tag our hero has; the blaster's tag is "Invulnerable".  But the blaster still opens the door.

Any ideas?
« Last Edit: August 06, 2014, 11:01:09 AM by Dreamwriter »

Sly

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #1 on: August 04, 2014, 12:36:37 PM »
Can you attach a screenshot of your playmaker action?
It will show us better if everything's right.

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #2 on: August 04, 2014, 12:50:59 PM »
Here it is

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #3 on: August 05, 2014, 04:08:32 AM »
Hi,

 You MUST attach a "PlayMakerUnity2DProxy" component for this to work. Please read the wiki page where you downloaded the Unity 2d Package, it's explained properly.

https://hutonggames.fogbugz.com/default.asp?W1150

If that's still doesn't work, let me know.


 Bye,

 Jean

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #4 on: August 05, 2014, 06:46:26 AM »
Add the proxy to the FSM script object?  We tried adding that to the door with the FSM script on it, and it didn't help.  The door functions when the player touches it, it just also functions when a laser touches it, though the laser's tag isn't "Player".
« Last Edit: August 05, 2014, 06:57:50 AM by Dreamwriter »

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 213
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #5 on: August 05, 2014, 06:30:40 PM »
While I am not dreamwriter I did have the same issue.  Not sure how I overlooked the proxy, but thanks that did it!

snortch

  • Playmaker Newbie
  • *
  • Posts: 31
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #6 on: August 05, 2014, 08:29:22 PM »
If I'm running playmaker 1.7.7.f6, do I need to install what Jean mentioned (https://hutonggames.fogbugz.com/default.asp?W1150) in order for 2d collisions to work?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #7 on: August 05, 2014, 09:57:17 PM »
Hi,

 in all playmaker versions you must have this proxy on your 2d gameobject if you want the 2d global events to work ( the proxy forwards them events, so no proxy, no 2d collisions or 2d triggers).

 Bye,

 Jean

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #8 on: August 06, 2014, 06:58:07 AM »
I've attached two new screenshots, the FSM (now with 2D proxy) activated and one showing the details of the green_shot that's activating it.  Any ideas?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #9 on: August 06, 2014, 08:05:33 AM »

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #10 on: August 06, 2014, 09:34:26 AM »
But we can, it is working.  The problem is not that we aren't getting collisions, it's that we are getting collisions and then the Playmaker code checking against the collider's tag isn't working, so the thing gets activated when it shouldn't.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #11 on: August 06, 2014, 10:00:10 AM »
Hi,

 I see, sorry about the confusion, you are using the global event on an action that is supposed to have its own unrelated event.

 under the hood "TRIGGER ENTER 2D" is fired by the proxy for ALL triggers, and the trigger2d action allows you to filter, but if you use this "TRIGGER ENTER 2D" then the action itself is completly shunted.

 so, do this test, create a brand new local event "MY TRIGGER" and use that in the action, it will work.  "TRIGGER ENTER 2D" and similar global events are only supposed to get used as global transitions not as event to use within actions.

Bye,

 Jean

Dreamwriter

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: Trigger 2D Event ignoring Collide Tag
« Reply #12 on: August 06, 2014, 11:00:21 AM »
That fixed it, thanks!

snortch

  • Playmaker Newbie
  • *
  • Posts: 31
    • View Profile
Re: [SOLVED]Trigger 2D Event ignoring Collide Tag
« Reply #13 on: August 07, 2014, 06:51:20 AM »
Jean - I think the answer you gave Dreamwriter might be the solution to my problems as well (http://hutonggames.com/playmakerforum/index.php?topic=8055.0), but I'm not quite following your fix suggestion.

When you said, "create a brand new local event "MY TRIGGER" and use that in the action, it will work." Does that mean that you're asking Dreamwriter to create an event and then add the "Trigger 2d Event" action to the State? Or are you saying that Unity automatically detects the trigger event and so the "Trigger 2d Event" action isn't needed?

Can you clarify?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
  • Official Playmaker Support
    • View Profile
Re: [SOLVED]Trigger 2D Event ignoring Collide Tag
« Reply #14 on: August 08, 2014, 04:34:42 AM »
Hi,

 ok:

 the global event "TRIGGER 2D EVENT" is a global event that my system fires everytime it detects that a 2d collider entered. This is exactly the same as the global system event build in PlayMaker "TRIGGER EVENT".

So, you should NEVER use global events that are fired from frameworks within an action ( within any actions), because then it's not just your action that can fire this event, it's anything since it's a global event, it can be fired from anywhere by anyone!

so, rule of thumbs, ALWAYS create a local event to use in your actions, and so in your  "Trigger 2d event" action, only use local events, and you will never get mixed up. "trigger 2d event" does filter by tag, and does a lot more work then just firing an event everytime something triggered that collider.

 Does that make more sense?

 a typical error as well would be to use a global mouse event such as "MOUSE DOWN" in your action. you may be tempted to do so in a mouse input action, but you understand that then how do you know if it's the action or the system that fired this event? do a test with a cube and an fsm with a bool test action ( that runs everyframe) with the "Is True" firing a "MOUSE DOWN" global system event, leave the bool to false and click your mouse on the cube, the event from the bool test will be fired... oups.... the same confusion goes one on the trigger 2d event and action.

 Bye,

 Jean