Concatenate variables in Debug.Log

Concatenate in one string:

Debug.Log("Value1: " + value1variable + " Value2: " + value2variable );

Use string.Format if you want to use a parameter list:

Debug.Log(string.Format("Position: {0} Ammo: {1}", Direction, playerAmmo));

Leave a Reply

Your email address will not be published. Required fields are marked *