Beginning C# - Part 19: Methods | Ray Wenderlich

In this video, you'll learn how to create methods and call them in your code.

This is a companion discussion topic for the original entry at

Thank you Brian, this is a very useful series of tutorial, I am understanding a lot of concept I had seen but never quite grasp.

Hey Brian,
I just had a question regarding the challenge. Is there a reason you created the new monster in start rather than just creating the new monster during the private variable’s declaration? this is how i went about it …

public int damage;
private Monster monster = new Monster(); // instead of just private Monster monster;
// and then in Start(){ monster = new Monster;

// Start is called before the first frame update
void Start()
    Debug.Log("Health: " + monster.GetHealth());

I didn’t run into any compile errors and the code functioned as it should have in Unity, so I guess I’m really asking, would the manner in which I have written my code pose problems in other areas for the future? Is there a specific reason, regarding whatever is happening “under the hood” as to why you created the new monster in the Start() method?

Thanks again these videos are terrific, and the feedback is appreciated more than you may know.


@bdmoakley Can you please help with this when you get a chance? Thank you - much appreciated! :]