Question: unity/c# question: NullReferenceException: Object reference not set to an instance of an object Deck.AddPips (.Card card) (at Assets/__Scripts/Deck.cs:239) what is this error and how can

unity/c# question:
NullReferenceException: Object reference not set to an instance of an object
Deck.AddPips (.Card card) (at Assets/__Scripts/Deck.cs:239)
what is this error and how can I fix it?
private void AddPips (Card card) For each of the pips in the definition... foreach( Decorator pip in card.def.pips) ...Instantiate a Sprite GameObject tG0 = Instantiate ( prefabSprite ) as GameObject; /1 Set the parent to be the card GameObject tG0.transform.SetParent( card.transform) // Set the position to that specified in the XML // Flip it if necessary if (pip.flip) tGO. transform. rotation Quaternion. Euler(0,0, 180); /1 Scale it if necessary (only for the Ace) if (pip . scale != 1) { tGO.transform .loca Scale = Vector3 . one * pp. Scale; // Give this GameObject a name tG0.name"pip" // Get the SpriteRenderer Component tSR_tG0.GetComponent
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
