playMaker

Author Topic: How to tell playermaker what to trigger and what not  (Read 555 times)

sneekyo

  • Playmaker Newbie
  • *
  • Posts: 4
How to tell playermaker what to trigger and what not
« on: January 10, 2024, 04:43:42 PM »
 I have an issue where I have "On Trigger Enter" that I want the player to trigger. However when a monster runs through it, it also triggers. How can I tell playmaker only to "On trigger enter" a specific Tag or Layer?

Maxi

  • Playmaker Newbie
  • *
  • Posts: 41
Re: How to tell playermaker what to trigger and what not
« Reply #1 on: January 17, 2024, 08:54:42 AM »
In the Project Settings under 'Physics' when you scroll down you find a raster of which layers can detect collision with which other layers.
Here you could set a layer for the triggers and make it so that it only registers collision with the layer that you want to to be triggered by.

Hope that helps.

LeDisciple

  • Playmaker Newbie
  • *
  • Posts: 35
Re: How to tell playermaker what to trigger and what not
« Reply #2 on: February 02, 2024, 11:27:05 PM »
Hi,
As MAXI said you can exclude layer in the setting but you can get it within your box collider.... It's better to tag your Monsters than a layer. Layers are most for UI or graphic environnement like "blood, snow, wheather, etc.) and use your trigger or collider tag exception, I know they are a little tricky but you need to "play" with these setting until you get what you need, dont know your version of unity but know there's a check box "provide contact'" who can help you in certains cases... ohhh and don't forget to set your box collider to "Is trigger" for the Game object. In this pic, I have invisible blocks on the road who waits for taxis to pass on them to send them events, and those taxis have also trigger/collider event depend of their all alone behaviour. If you look at my states, you'll see that I'm making a traffic made only with PM... with stops and decisions to go in any direction when entering those invisible blocks even slow down before stops until they arriving at destination without predefine route.


For your problem, if I understand, both do action when colliding? As I said, I tag my "taxi" and my "crossroads" so when one enter another one they do something and i tell the other one to not, vice versa. and don't forget you have the "Collision Event" who can help you. I can't tell you specifically what you need because Collider can serve as Trigger and by our concept one collider object is not the same as the other one because of its behaviour.

I have included a last picture of the possibilities of PM, I have 4 trigger on the same object with 2 Box collider who call seperate trigger/collider event..


And my last word... don't forget rigid body on your testing! ;)

Regards and Good luck! :)

« Last Edit: February 05, 2024, 09:57:03 PM by LeDisciple »