I kinda understand when OnTriggerStay every object in that trigger will be registered. But why when I apply damage meaning change their Variable only 1 get the change every millisecond, but nothing happens with other objects.
My schematic just simple like this:
OnTriggerStay->Change Variable 'HP' of Object 'Starting machine' Int Sub 1
It works for the first object that enters it and stays there. But not for every others object that also enters and stays there.

I had used the 'Find nearest object' node and used 'Add' It works but is also lead to another problem even that object has exit the Trigger it still on the selected data and damage still apply to it.
When I used the 'Clear selected data' node OnTriggerExit. And that leads back to the first problem but difference. Now instead of the first got damage applied the last object that entered it got damage applied.

Now it makes me feel like I don't understand how schematic machine work. But basically, I know how schematic and machine work. Just don't know how code really works. (= =!)
  • What's your trigger machine's setup?
    Try using the Multi execution type - using Single for this will most likely lead to only one of the objects being executed, as the schematic is already running when it's the other's turn. The Multi execution type allows running multiple schematics at the same time.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Well! Multi execution is what I try to avoid. To see if Single execution has any method to trigger multi-object at the same time. So far I had success with 'Select nearest object' node but don't know how to remove selected data when an object leaves the trigger. That is what I want to achieve right now.

    But If you said use Multi because there is no other option to remove selected data from the right object when it leaves the trigger. Then I don't have any other choice than just use it then.
  • Unless there's really a lot of objects that'd be starting this at the same time, I'd recommend using Multi so that a schematic is executed for each object.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.