Debug.Log a gameobject in C ?

Hello i need to make something very easy in java but can’t do it in C.
Just debug log 2 value, bounds and gameobject.

Why this don’t work ?

public GameObject debuggo = new GameObject(); //( don't)
public GameObject debuggo =GameObject;// ( don't)
public GameObject debuggo =gameObject;// ( don't)
public GameObject debuggo =This;// ( don't)

Debug.Log(bounds);// ( work )
Debug.Log(debuggo);// ( don't )
Debug.Log(bounds , debuggo);// (don't ) -----> I want something like this to have the name of gameobject that i debug.
Debug.Log(bounds , gameObject); //(don't )
Debug.Log(bounds , GameObject); //(don't )

The Debug.Log method accepts a string as a parameter. Things like intergers are converted automatically but you can’t just “add” things with a comma because a comma used like this makes no sense to the method. You have to insert it between the parts of the string with the plus symbol and make the comma itself a string by putting it between double quotation mark.

 Debug.Log(bounds +", " + gameObject);

Also, you mean C#. C is a different programming language.

I have delet my var gameobject declaration, ( no need that )
and writte

Debug.Log(bounds +", " + gameObject);

As you said Cherno and work.
Thanks :slight_smile: