Objective: initialize start position for the player.
Create a New C# Script
Create a script folder and add a c# script in there by right click > Create> C# script. Name the file as Player when it first created *if renamed afterward, you will need to adjust the class name afterward.
C#
Double click on the script and open it with Visual Studio Code, or any preferred text editor.
a. Name Space -library included.
b. Class Name -Make sure the class name match the file name.
c. Void Start -function called once when the game start.
d. Void Loop -function that repeat every frames (~60fps).
Change Default Scripts Editor
To change the default IDE, go to edit>preference>external tools>external script editor
Set player starting position
I am going to use void start to set the player starting position to (0,0,0) so it will snap to the center in the beginning of the game
Now when I press the play button for test play, the cube should snap to the middle