Weird bug in a health script

I made a health script for a game, it works fine, but it gives off a weird error that gives low framerate.

Error:
“StackOverflowException: Max recursion depth of 100 has been exceeded. Consider increasing ‘Recursion.defaultMaxDepth’.
Ludiq.Recursion`1[T].Enter (T o) (at Ludiq.Core.Runtime/Utilities/Recursion.cs:27)
Bolt.Flow.BeforeInvoke (Bolt.ControlOutput output, Bolt.Flow+RecursionNode recursionNode) (at Bolt.Flow.Runtime/Flow.cs:408)
Bolt.Flow.Invoke (Bolt.ControlOutput output) (at Bolt.Flow.Runtime/Flow.cs:339)”

Set Text is giving off the error
EDIT: Fixed

This is totally normal. You are in an update event loop and your units will execute from the Update Event unit at every frame. What you are doing, is an infinite loop inside of a frame.

1 Like

Thanks it worked.

1 Like