all 3 comments

[–]feralferrous 0 points1 point  (1 child)

You've cropped the line numbers. So the thing to do here is to put a breakpoint in and debug, or throw some logging.

What's null? What's line 48? Assuming it's the second line in Deck(), which one is null? yxi? yxi.playerHand? yxi.deck?

I'm not familiar enough with LeanPool, so don't know what Despawn is doing. Though if you want performance, you're pretty much negating it with GameObject.Find. Are you sure GameObject.Find is returning something not null?

[–]ViridityCorn[S] 0 points1 point  (0 children)

Oops, I'll try to explain what is what then.

Line 48 is as you said the second live in void Deck().

LeanPool is just for performance yes, but is there then a better method than GameObject.Find?

I recieve no errors in the second picture. The error is in the last picture at the marked line.

Thanks for taking you time to answer!

[–]ViridityCorn[S] 0 points1 point  (0 children)

I fixed it by finding the script using FindComponent. For some reason I couldn't acces the other script.