i'm making a basic pong clone, and i'm trying to make a basic ai for the enemy paddle. to do this i need a function that predicts where the ball will land on the right side whenever the ball changes direction. right now, my implementation is a recursive call to querySpriteInfoAlongLine (i would use querySpritesAlongLine, but as you could guess i specifically need the entry point)that does a raycast every time the ball hits a floor or ceiling until it hits the wall.
this works fine in the simulator, but crashes on the device; my best guess is that this recursive function is taking more than 10 sec. has anyone else run into this issue before, and is there a cheaper alternative i could use?