GetScoreByColor Causing Infinite Loop – Data Table Lookup Not Working

I’m trying to create a scoring system for a dartboard game using a Data Table (DT_DartboardScoring). This table contains Color → Score (int) pairs.

I created a function called GetScoreByColor, which takes a LinearColor (from Read Render Target Pixel) and loops through the Data Table rows, checking for a color match. However, I’m encountering two issues:

  1. If I connect the False branch back to the For Each Loop, it causes an infinite loop.
  2. If I remove the False → Exec of ForEach Loop connection, I believe it doesn’t loop through all rows because it never finds the score for the given color.

Blueprint Logic

  • I use Get Data Table Row Names to retrieve all rows.
  • I loop through the rows, using Get Data Table Row to get the Color column.
  • I then call CompareColors
  • If a match is found, it returns the score. Otherwise, it should continue looping.

Blueprint Setup