Download

Best way to handle overlapping multiple objects and saving their tags for comparison

So i’m still rather new to node coding and i’ve been racking my brain with this for awhile now. I have a situation where i need to “cut” something in vr with a knife.
Since i don’t need it to actually separate or anything, i thought i would do it so that the area i need to cut has multiple little boxes with different tags. Then when they overlap with the blade object, it saves the objects info (name/tag/etc) and if every object has been hit, it does something.
But i simply cannot get this to work no matter how i rack my brains with it. Then there is the problem of VR collision when having objects in virtual hand but that’s a problem for another day! Anyway any pointers would be a great help! Thank you in advance.

I propose doing this the opposite way around.

  1. Knife cut situation starts
  2. Add BoxesToCut to an Array (You can simply use direct references here, no need for tags)
  3. Player overlaps a box
  4. Player checks box overlapped against array, and removes it from array (simply: if array contains overlapped actor, remove from array)
  5. On removal, check if array is empty. If so, then all boxes must have been cut.

Will most certainly give this a try today. Thanks so much! Never would have thought of that.