here is the code
The part which is commented here is giving error when i play . it isnot assigning in the ui tmp .
I tried using non canvas prefab for Cards , but i want it in ui only. Sorry for not addresing the problem clearly(i am not good at coding ).
Try changing the TMP Gui variables to TMP_Text if you are using Text variables & assign them in the editor.
This could also be one of your card values being null. Try debugging and seeing for yourself, if you dont know how to debug check this out https://youtu.be/wt2YdrUlzgg