How do I fix this error on the index being called in an array?

I’m trying to use the current Index from the For loop as an Index on the array to be used. But this error is appearing. How do I fix this?

image

This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context. The ‘decides’ effect indicates that the invocation calls a function that might fail, and so must occur in a failure context that will handle the failure. Some examples of failure contexts are the condition clause of an ‘if’, the left operand of ‘or’, or the clause of the ‘logic’ macro.(3512)

    OnBegin<override>()<suspends>:void=
        for (pSpawner : pSpawners):
            pSpawner.SpawnedEvent.Subscribe(AddUI)
1 Like

Thanks, it solved!

1 Like

in this case, the same happened, i’m just trying to use an int ‘0’ as index but the same error appears

image

image

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.