Infinite Loop error (no obvious loop)

just from reading your description is sounds like you are turning the collision on and off very quickly and repeatedly. the collision is turned of when the player overlaps right, then you disable collision which would in effect be end overlap. on end overlap you are turning collision back on, so your turning collision back on which would be begin overlap again, which in turn would create a loop.

maybe try having something like begin overlap → disable collision → delay → enable collision. or maybe just put a delay after your end overlap and before the enable collision. in either case a delay would greatly reduce the times that the script is looped which would get rid of the error and crash.

course this is just a theoretical idea.

2 Likes