playMaker

Author Topic: Unity getting confused with triggers  (Read 2428 times)

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Unity getting confused with triggers
« on: November 27, 2013, 09:45:07 AM »
Hello, i'm having an issue with unity getting "confused" (really i'm the one who's confused hehe) over multiple meshes interacting with a trigger. everything works fine when one mesh enter and exit a trigger. my set up below:



when I add multiple meshes though the trigger gets stuck with what the first mesh entering it is doing. I thought maybe adding a trigger event: stay would fix it but I'm not sure how to implement it, can somebody help me please ?

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Unity getting confused with triggers
« Reply #1 on: November 27, 2013, 10:32:28 AM »
I played around with this until I found a fix,this :



FIXED :D

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Unity getting confused with triggers
« Reply #2 on: November 27, 2013, 10:42:34 AM »
Ok, not fixed actually, this works fine with 2 enemies but adding more gives the same problems as before :(

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Unity getting confused with triggers
« Reply #3 on: November 27, 2013, 12:21:47 PM »
I'm still struggling and I don't think I've explained myself very well, basically this is happening:



last message from me, I don't know how to explain it better :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Unity getting confused with triggers
« Reply #4 on: November 27, 2013, 12:39:25 PM »
you have to keep cycling through the check if youre detecting multiples. One enemy exiting is making it fire the exit event, so just check to see if there are is still something in the zone whenever there is an exit trigger done.

Might help to research feedback loops or PID controllers to understand how the system needs information and how you can best set things up so it can do things properly.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

inediblered

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Unity getting confused with triggers
« Reply #5 on: November 27, 2013, 01:06:34 PM »
I understand but do you know how would I check? which action should I use ?

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Unity getting confused with triggers
« Reply #6 on: November 27, 2013, 04:01:36 PM »
@Lane, can elaborate on the feedback loops and PID controllers concepts, quite new for me.
@Inediblered, a cheap solution could be to count the number of enemy entering in the trigger with an Int Add action and and Int Substract on each trigger exit.
Visit my portfolio: http://www.yanivcahoua.com/