How to find the biggest number in the variable with many instances in anoher actor

Hey @primaldragon100!

You can achieve this by following the steps below:

  1. Get a For Each Loop node and plug the Out Actors pin of the Get All Actors of Class into it’s Array pin
  2. Create an int type array and store the current element’s speed (which you can get from the Array Element pin) inside the array using the Set Array Elem node. And leave the Index pin of the node as 0 (also check the Size to Fit option)
  3. Compare the first element of our array (which you can get using the Get node and leaving the index as 0) with the second one using a “>” (is greater than) and a Branch node. Make sure to plug the first element into the A pin (the upper one) of the “>” node and the second into the B pin (the lower one)
  4. After the True pin of the Branch node, use the Set Array Elem node again to set the second element of our array to the current element’s speed (or the first element of our array). So you’ll need to set the Index pin of the node to 1 this time as the one single difference from our first use case of this node.
  5. After the False pin of the Branch node, check if the first and second elements of our array are equal using an “==” (is equal to) and a Branch node.
  6. After the True pin of our second Branch node, plug our array into a Shuffle node. Then set the second element of our array to the first element of our array the same way we did in step #4.

Before all of these, store the first ever element’s speed inside our array as the second element, and only then start triggering this logic for the next loops. There’re a bunch of ways to do that, you can see one of the ways to do it from my latest post under this topic.

And here’s an image of the whole thing that I was able to make after launching my PC:

Hope this helps! :innocent: