playMaker

Author Topic: how to get the tag when an object is hit by another?  (Read 487 times)

neversuki

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
how to get the tag when an object is hit by another?
« on: January 06, 2014, 08:41:53 PM »
I set 3 tags in the engine, player, other, invincible.
When my character in different status(tags), the objects in the world will give different responses after hit by him.

Now i have to set 3 playmaker components on objects.
I think the better way is let the objects know which tag he hit, and compare the tags, and lead to different response. but i can't find the playmaker actions like this.

Is playmaker give some actions to do like this?

sorry for my poor English, thank you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: how to get the tag when an object is hit by another?
« Reply #1 on: January 07, 2014, 03:05:37 AM »
Hi,

 Few things.

 You can use the action "get tag" on any gameobjects, so that's a good way to check then using "String compare" action.

Also, if you want to use triggers and collisions events, use "Trigger Event" action and "Collision Event" action, because they allow you to filter by tag so you could define logic that you know will only triggers based on a specific tag.

bye,

 Jean