Setup New Scene

0
10

I recommend you to duplicate the demo empty scene (designed to reskin easily) and modify only the UI sprites otherwise you will have to create a complete canvas and set up all these variables.

First you need to create the game manager, AI Manager if you want spawn Artificial Intelligence, and the Input Manager.

1- Create an empty gameobject and attach to it the following scripts:

Game Manager

AI Manager

Input Manager

In the GameManager you need to drag and drop the UI Elements because they are handled by code.

Also you have to create empties gameobjects and add them to Team 1 Spawn Points and Team 2 Spawn Points, here will spawn all the players selecting one of these positions on the scene randomly (according to his team). It is used as a reference of a good spawn position on the scene

You should look at the documentation for details of every single variable.

In AI Manager you have the prefabs of the enemies (Located on Prefabs-Resources folder) you want to spawn in the game, the Team 1 is the team of the player, if you put some AI Prefab inside this array will be of the Player Team, otherwise will be the enemy for the player.

The AI Players Team variable is the times you want to spawn these prefabs if you put 1 AI Prefab and put it on 3, will spawn 3 AI Players.

The Patrol Points are an empty gameobject in the scene to use it like a reference of the position where the AI will go at the start, usually it is in the middle of the scene, once the AI arrive this point, it will start searching for his enemy. (See Documentation for more information).

Input Manager: It is set by default, I recommend you don’t change it, it uses the standard input in all games and in all platforms. But if you want to change it you can go to Edit-Project Settings-Input and change some inputs, the inputs in  unity have a name to recognize it, and that is what is set on Input Manager, the names of the Input, the name really doesn’t matter.

SHARE
Previous articleInstagram Clone setup