Infinite loop detected after removing Cast To ThirdPersonCharacter Node

hey guys I am unity programmer and recently learing amazing unreal engine. and of course stumbling with errors as usual.
I am just following virtus’s running game tutorial and it works well

this is blueprint of obj
I thought the ‘cast to thirdpersoncharacter’ node seems doing nothing here so I just removed it like this.

play the game and you know I got the infinite warning error when it is triggered.
I couldn’t figure out what’s wrong. I guess I am just missing simple concept here.

and this is the function the ‘Spawn Tile’ in game mode blueprint

255211-function.png

any answer would be thanksful

I thought the ‘cast to thirdpersoncharacter’ node seems doing nothing here

it was actually providing your flow control, basically it was making it so the script beyond it would only fire if the overlapping actor is of the thirdpersoncharacter class. now i dont know what actor your in or what your aim is but i would venture to say that it is overlapping something and it is possibly moving which would result in the infinite running of the script. this isnt exactly a infinite loop but when any script runs too many times it may as well be.

The third person character variable is not used, but it’s cast works like a check to only proceed if it’s a character that’s overlapping in, otherwise any object will overlap with it and throw thousands of errors will be throw since only the character were the one supposed to overlap with it.
Usually you should check this kind of thing without using tasks, since they are expensive. If you’re used to program using Unity, probably you should look for a Tag comparison instead of checking if a cast succeeds.

oh thanks I fixed my problem with your answer.
so that cast node is a branching node as well, cool!