I’m not looking down at myself.
Hard to tell precisely without observing what is going on or knowing what else is needed. If I were to guess, I’d say this probably happens when the coin is not on the screen. Can you confirm? Or perhaps there is no coin to draw to line towards?
Is there a warning / error perhaps?
Btw. If you’re ever only need a single line, this can be probably simplified greatly.
A quick fix:
- check if the Coin is valid
- check if its returned screen position is valid
- if any of the above fails, don’t draw the line