playMaker

Author Topic: Send different events depending on what object you collided with...  (Read 1190 times)

Madame

  • Playmaker Newbie
  • *
  • Posts: 1
Basically as the title says. I have Object A, which the player controls. When it hits Object B, I want one event to be triggered, while a different event is triggered by hitting Object C.

I know it's a stupid question, unfortunately I missed the class that the others covered this in >.<

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Send different events depending on what object you collided with...
« Reply #1 on: June 12, 2015, 07:09:32 AM »
Hi,

 You have several ways:

-- either each object is responsible for sending events, in which case, each can send their own events.

-- the listener filters by tag using the action "Trigger event"

-- the listener catch all triggers, get the gameObject that triggered and do some checks, maybe by name, by tag, by layer, or by querying the object itself ( get fsm XXX action to access local variables on other fsm).

 Bye,

 Jean