Basic one yet I can't Figure out!

I have reached lecture 54 in Unity 2D Game development Course. I am new to programming , I have watched all the lectures but still I have a hesitation where to code either in Start or Update or Neglect both the default methods and create one! Can someone help me with the above mentioned methods and where to use it?

Thanks in advance :slight_smile:

Well it depends on when you want this code to be executed. These default methods are not there randomly, they are special methods called by the engine itself.

When you place code in Start(), it gets executed when you click on Play, while Update(), gets executed every frame. If you want to write your own method and call it from somewhere else, you can do that too, but it must be called from an Event Function (like Start or Update).

Check Unityโ€™s documentation about Order of Execution here, it is very handy:
Order of Execution

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms