What are the steps to set up the project after cloning it from GitLab?

I get various errors when playing the project immediately after cloning here (what should I install/import?): GameDev.tv / Unity Multiplayer Course / RealTimeStrategy · GitLab

Hi, there are lectures at the beginning of the Unity Multiplayer Course course instructing you which packages to install. As well there is a new lecture at the end that includes any updates you need to make to get the project working in recent versions of Unity/Mirror.

When I import Mirror in the final project, I get duplicate files that cause other errors in the final project because of the existing Mirror folder. Before installing Mirror, I get runtime errors with starting the Scene_Map_01:

Thank you for your help!

Delete the Mirror folder completely before reimporting it.

I’m still getting the same runtime errors, and they mostly seem to be with this line:

player = NetworkClient.connection.identity.GetComponent<RTSPlayer>();

(With the Scene_Menu scene I only get Steamworks errors, so I assume for that I can just follow the Steamworks install instructions.)

This is usually an issue with trying to get a hold of the player before the connection is ready.
Try adding a “?” to the connection:
player = NetworkClient.connection?.identity.GetComponent<RTSPlayer>();

Otherwise, many students have used a coroutine to get a hold of the player with an added delay of 0.5 seconds to avoid the error. You could try this as well.

Could you please show me how to add the coroutine? (The player reference is needed later to solve some of these errors.) I am starting the game from Scene_Map_01 and not the main menu so I’m not sure if that also contributes to the errors.

You should be starting from the menu scene. I suggest working your way through the course in order to understand correctly. I am limited in how I can help you if you have not covered the course material.

The coroutine can be a standard coroutine with a WaitForSeconds of 0.5f before the player get component.

1 Like

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

Privacy & Terms