User Guide
User Guide
ly/1fIMCdr
Table of Contents
Getting Started ..................................................................................................................... 4 Frequent References ......................................................................................................... 4
Player ............................................................................................................................................... 4 Patch ................................................................................................................................................. 4 Spline................................................................................................................................................ 4 CPs ..................................................................................................................................................... 4 Custom Menu ................................................................................................................................. 4
How to Change the Script Type (Javascript & C#) ................................................... 7 Adding an Obstacle.......................................................................................................... 10 Replacing Player Character.......................................................................................... 14 Adding a Sound ................................................................................................................. 17 Adding a Patch .................................................................................................................. 22
Adjusting CPs of a Straight Patch .........................................................................................27 Adjusting CPs of a Curved Patch ...........................................................................................27 Switch between Custom Menu and NGUI ..........................................................................31 Menu Script Architecture (Custom Menu) ........................................................................32 Adding a Custom Menu ............................................................................................................33 Adding a Custom Shop Menu .................................................................................................39 Adding a new Costume Shop Item .......................................................................................39 Adding a new Power-up Shop Item .....................................................................................44 Adding a new Utility Shop Item ............................................................................................45 Adding a new IAP Shop Item ..................................................................................................46
Replacing the Enemy Character ................................................................................. 47 How to Switch between Gyro and Swipe Controls ............................................... 49 Adding a Power-up .......................................................................................................... 50 Adding a New Mission .................................................................................................... 53 Adding a New Achievement.......................................................................................... 55 Project Exceptions and Resolutions .......................................................................... 57
EXCEPTION: Character material not assigned to costume shop element..............57 EXCEPTION: Character texture not assigned to costume shop element ................58 EXCEPTION: No cost assigned to the costume shop element. Check the user documentation. ..........................................................................................................................59
Introduction
Getting Started
1. Import the unity package into an empty project. 2. Go to Project > Scenes > Scene_1. 3. Click Dont Save if prompted to save the current scene. (The project only uses a single scene file) 4. Press the play button to get an idea of the menu flow and gameplay.
Frequent References
The documentation will frequently refer to some elements that are the core of the project:
Player
The Player is the prefab that contains the primary character of the game. This prefab also has a number of scripts attached to it. The word Player will not be used to refer to the user in this document. The Player behavior is controlled by ControllerScript.js or ControllerScriptCS.cs.
Patch
Patches are the environments/ surroundings of the game. They are generated by PatchesRandomizer.js or PatchesRandomiserCS.cs during run time. Each patch has the default displacement of 3000 meters. At any particular time, two patches are always active, the one the Player, is on and the immediate next one. Every time the Player passes a patch completely it is destroyed and the next one is generated.
Spline
The spline is a line passing over each patch, which defines the path of the Player and the location where obstacles will be generated.
CPs
The spline is manipulated using CPs, which is short for Check Points. If the patch is completely straight, only two CPs are needed to draw a straight spline. However, if the path has bends and curves, multiple CPs are needed to be arranged to draw a spline that has exactly the same shape and centered on the path of the patch. Take a look at the sample patches to acquaint yourself with how CPs are related to the spline.
Custom Menu
The default GUI consists of a set of menus and the HUD. It is referred in the documentation and script comments by the term Custom Menu. This is because the GUI implementation does not use the GUI class or most of the components provided by the Unity Engine.
The term NGUI Menus is also used frequently which as the name suggests refers to the menus and HUD implementation using the NGUI library. The menus designed and programmed using the NGUI library are complete replicas of the Custom Menus. The developer has the choice of using the one most suitable to their needs.
Audience
The user guide is composed assuming that the reader/ developer has an understanding of game development in Unity and Javascript or C# programming for Unity.
Project Architecture
The project doesnt use much of the physics, GUI components etc. provided by the Unity Engine to maximize performance on mobile platforms.
Physics
The character/ player physics has been defined as needed in the ControllerScript.js or ControllerScript.cs.
Menus
There are two types of menu implementations provided in the project. The first one is the Custom Menu that is primarily controlled by the MenuScript.js or MenuScriptCS.cs. The ShopScript manages the shop components of the Custom Menu. A few additional scripts in the Shop Menu manage its smaller components. The menu has been explained in detail in the Adding a Menu section. All the scripts of the Custom Menu can be located at Project > Assets > UI > Custom > Scripts if you are using Javacript or Project > Assets > UI > Custom > C# Scripts if you are using C# programming language. The second type of menu has been implemented using the free version of the NGUI library. All the scripts and assets used in the NGUI menu can be located at Assets > UI > NGUI. The scripts used by NGUI are only available in the C# programming language.
Collisions
There are two kinds of collisions detected during gameplay. The first and the most common one is the front collisions with obstacles detected and handled by the PlayerFrontCollider. The second type of collisions is called stumble which are detected by PlayerSidesCollider if the Player bumps into an obstacle sideways. This triggers the Enemy (police car by default) to chase the Player for a unit time (5 seconds by default) and then move out of the camera. If the player stumbles (collides sides ways) into another obstacle while the Enemy is chasing it, game over routine is called and the death scene is played.
Sounds
All the sounds used in the scene are 2D sounds. All the audio sources have been added to the SoundManager prefab located in the scene. A script also named as SoundManager has been added to the prefab and is responsible for playing or stopping a sound as needed. Exposed variables are used to hold the references of the audio sources.
Code snippet where animation type is determined The legacy-animated character can be found at the path: Project > Assets > Characters_Prefabs. Alternatively the mecanim animated character and all its dependencies can be found at Project > Assets > MecAnim System folder.
The cubeman .fbx file contains the animations that will be applied to the prisoner character. The Prisoner(MecAnim) .fbx file is the character mesh that will be rigged and animated in Unity. To work, it has to be placed at Hierarchy > Player > PlayerRotation > PlayerMesh. The PrisonerAnimController is the Animator Controller used by the Prisoner(MecAnim) prefab.
A message will be displayed on the Console window telling you that the script type has been switched successfully.
2. You now need to tell the ElementGenerator script again about which obstacles, power-ups and currency prefab you are using so that it can generate them on the path. To do that: a. Click Hierarchy > Player. b. Expand the ElementsGenerator script. c. Expand the Obstacle Prefabs array. d. Allocate memory according to the number of obstacles in your project. e. Drag all the obstacles from Project > Assets > Obstacle_Prefabs folder to Obstacle Prefabs array in the script as shown in the screen shot.
f. Next do the same for the Powerup Prefabs array and the Currency array. Drag and drop the prefabs from the Project > Assets > Powerup_Prefabs folder to the array as shown in the screen shot below:
3. The final step is to tell the PatchesRandomiser script about the environment patches we will be using. To do that, drag the patches prefabs from the Project > Assets > Patches_Prefabs folder to the Patches Prefabs array in the PatchesRandomiser script.
Thats it, go ahead and hit play to check if everything is working as expected. Notes: - The script type is changed by the ToggleScriptType.cs script located in the Project > Assets > Editor folder. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
The script type is changed by removing the current scripts from the prefabs located in the Hierarchy and replacing them with the alternative scripts. - The EditorAttributes file located in the Project > Assets > Resources folder carries the information about the type of scripting language currently active. Optimization Note: - Several prefabs that are generated at runtime carry both C# and Javascript version of the same script. The scripting language currently in use makes the use of the appropriate script. Its best to remove one of these scripts once you decide which scripting language to use.
Adding an Obstacle
1. Import the .fbx of the asset that you will use as an obstacle.
Optimization Notes: - Use Model > Scale Factor to adjust the scale. - Use Model > Mesh Compression to compress the imported asset as much as you can without compromising its appearance. - Select None in Rig > Animation Type if your asset isnt rigged. - Uncheck the Import Animation option in Animations > Import Animation if your asset isnt animated. 2. Drag the imported asset in Hierarchy tab to create a prefab.
3. Select Component > Physics > Mesh Collider to add a mesh collider to your obstacle asset.
Optimization Notes: - Use primitive colliders such as Sphere, Box etc. for better performance during gameplay. - Do not scale the collider component on your prefab for optimizing object pooling. 4. Select Layer > Obstacles_lyr in the Inspector tab. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
Note: Make sure the object with the collider has the layer Obstacle_lyr. You can also change the layer of all the objects of an obstacle prefab to Obstacle_lyr to keep things simple.
5. Go to Project > Assets > Scripts > Elements. 6. Add the ObstacleScript.js on your obstacles prefab.
7. Set the Obstacle Area Type on the Obstacle Script Component. 8. Set the Frequency. (Default Value is 10) The latest User Documentation can be found at: http://bit.ly/1fIMCdr
9. Drag the newly created prefab to Obtacles_Prefabs or any other folder in the Project tab to create a prefab.
10. To make the created obstacle appear on the path during gameplay, you need to add it to Hierarchy > Player > Elements Generator > Obstacle Prefabs. 11. Remove the newly created obstacle from the Hierarchy tab before launching the game.
Optimization Notes: - Use Model > Scale Factor to adjust the scale. - Use Model > Mesh Compression to compress the imported asset as much as you can without compromising its appearance. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
Note: If you are working with the legacy animation system, the ControllerScript uses all the animations listed in the above screenshot. If a certain animation is not defined, an exception will be thrown when the script attempts to play that animation. 3. Drag the imported asset in Hierarchy > Player > PlayerRotation > PlayerMesh.
4. If you are working with the legacy animation system, make sure the Animation component of the character prefab has all the animations that will be used by the ControllerScript.
On the other hand if you are using the mecanim animation system, make sure the Animator component has everything it needs to run the animations.
5. If your character prefabs dont have the default names used in the project, make sure you change the name in the Start function according to the animation system used, so the ControllerScript knows where to get the animations from.
Adding a Sound
1. Go to Project > Scripts > SoundManager. 2. Add the sounds name in the relevant enum. Lets take the Siren sound played by the police car as an example.
3. Import the sound. (Drag and drop the sound from the Finder/ Window to Project > Assets > Sounds)
Optimization Notes: - Change the Audio Format and Load type as needed. - Uncheck 3D Sound as the project by default doesnt uses 3D sounds. 4. Select Hierarchy > SoundManager. 5. Select Component > Audio > Audio Source. (This will add another Audio Source to your SoundManager prefab to be used later)
6. Drag the sound from Project > Sounds to Audio Source > Audio Clip of the newly created Audio Source Component.
7. Increase the array size of the relevant array. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
8. Drag the Audio Source and drop it as the last index of the array.
9. Use the playSound() function from SoundManager in the scripts where you need to use the newly added sound.
Adding a Patch
1. In the Hierarchy tab, add a new game object by selecting GameObject > CreateEmpty.
Optimization Notes: - Use Model > Scale Factor to adjust the scale. - Use Model > Mesh Compression to compress the imported asset as much as you can without compromising its appearance. - Select None in Rig > Animation Type if your asset isnt rigged. - Uncheck the Import Animation option in Animations > Import Animation if your asset isnt animated. 5. Drag the imported .fbx and drop it in the created empty game object.
6. Select the floor of your patch where the character will run and perform two steps: a. Select Component > Physics > Mesh Collider. b. Select Layer > Terrain_lyr.
7. Select Project > Patches_Prefabs > Sample_CPs. 8. Drag the CheckPoints_Straight prefab into the patch prefab if your patchs path is in a straight line. If the path is not in a straight line, drag the CheckPoints_Curve instead.
9. Rotate the patch if it does not have the same orientation as the spline.
b. Select Hierarchy > *patch name* > CheckPoints_Curve. c. Select all the CPs. d. Check the Mesh Renderer component from Inspector > Mesh Renderer. (This will display all the Check Points that shape the spline)
e. Adjust the CPs so that the spline is centered on the path at every point on that path. You can only change the position of the CPs; changing their rotation or scale will have no effect on the spline.
Notes: Make sure your Editors camera is in Isometric mode. (You can change the camera mode by clicking the cube in the top right corner of the screen.) Make sure the Editor is in top view. You can add or remove CPs as required but make sure not to miss a number in the sequence. f. Check off the Mesh Renderer component from Inspector > Mesh Renderer when youre done adjusting the spline. g. Click CheckPoints_Straight/ CheckPoints_Curve or whatever you have named the prefab containing the checkpoints.
h. From the title bar, select Custom > Patch CP Generator. (This saves all the changes you have made to the spline)
i. j.
Select the *patch name*. Drag the patch to Project > Patches_Prefabs to save the created prefab.
10. Once the patch has been saved, select Player > Patches Randomizer from the Hierarchy. 11. Increase the array size of Go Patches Prefabs. 12. Drag and add the newly created patch from Project > Assets > Patches_Prefabs, to the Go Patches Prefabs array.
1. Disable the HUDMainGroup located in the Hierarchy. 2. Disable the MenuGroup located in the Hierarchy. 3. Enable the UI Root (2D) prefab located in the Hierarchy. Switch from NGUI to Custom Menu To enable the custom menu, you need to enable HUDMainGroup and the HUDMainGroup. Then to disable the NGUI menu you need to disable UI Root (2D).
1. Enable the HUDMainGroup located in the Hierarchy. 2. Enable the MenuGroup located in the Hierarchy. 3. Disable the UI Root (2D) prefab located in the Hierarchy.
for any interaction with the screen. If the user taps on the screen, the camera raycasts the menu in search of the button tapped. If the raycast finds a collider in its way, a relevant handler is called. By relevant, we mean the handler of the active menu. Finally, the third layer consists of handler functions. Each menu has a single handler function that defines the implementation of all the buttons the menu has. When the listener function calls the handler function, it also passes the transform of the button tapped as a parameter. The handler function uses this transform and compares it with the array of buttons transforms, to check which buttons implementation to execute.
Button
The GUI buttons
Listener
The listenerClicks() function called repeatedly by FixedUpdate()
Handler
The handler function of each menu.
By convention in the project, an empty GameObject is created to contain the backgrounds, icons and buttons (GameOver is used as an example in the above screen shot). All of the buttons are enclosed in yet another empty GameObject named Buttons. Each button is a plane that also has a box collider as a component to detect raycasts (raycasts are used to detect taps on buttons). In the following example the button named Button_Back is shown with all its components. Notice the low-poly plane used instead of the default plane used by Unity. Secondly, observe that a box collider has been attached to the button to detect raycasts. A box collider can be added by selecting the plane and then selecting Component > Physics > Box Collider from the title bar.
1. As mentioned before, make sure all components of the menu are enclosed in a single game object. (For the sake of example, lets call the menu GameOver) The latest User Documentation can be found at: http://bit.ly/1fIMCdr
2. Place the GameOver prefab in the MenuGroup prefab located in the Hierarchy tab along with its components.
3. Set the position of the GameOver prefab at 0,0,5000. (This brings the prefab into the HUD Camera as the HUD Camera is located at (0,0,5000))
4. Double click on Hierarchy > HUDMainGroup to display it in the Editor and make sure the menu items are facing towards the negative x-axis. The screen shot shows the menu title, the buttons, the semi-transparent background and also the HUD elements in the background (ignore these while designing a menu or disable the HUDMainGroup if these are in the way but make sure to enable it once your done with the menu). The latest User Documentation can be found at: http://bit.ly/1fIMCdr
5. Open the MenuScript.js from Project > Assets > UI > Scripts or C# Scripts. 6. Add the name of the newly created menu in the MenuIDs enum.
7. Create a Transform type array to store the transforms of the buttons in the GameOver menu. 8. Create an integer type variable to store the number of button in the GameOver menu.
9. Store the GameOver menus transform the tMenuTransform array. 10. Initialize the transform type array that holds the references of the buttons in the GameOver menu. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
11. Create a handler function for GameOver menu to define the implementation of its buttons. In our case, we have two buttons.
12. Add a new case in the listenerClicks function. This function will call the GameOver handler function if its button is pressed.
13. Add a new case in the ShowMenu() function to display the GameOver menu prefab when needed. Setting the prefabs y position to zero brings it in front of the HUD Camera.
14. Add a case and its implementation in the CloseMenu() function as shown below. Setting the prefabs y position to 1000 moves it away from the HUD Camera.
Note: Whenever you need to use the created menu, call the ShowMenu() function passing the appropriate parameter. Similarly, to close the menu, call the CloseMenu() function with the same parameter. 15. Set the position of the newly created GameOver menu prefab to (0,1000,5000). This will remove it from the HUD Camera in default conditions.
2. Set the transform and rotation values of the prefab to zero and set the scale to (1,1,1).
3. Now populate the Utilities game object with all the menu components you need it to hold. You can try copying these components from other menus or adding new textures. Make sure to set the Mesh Filter component to Plane2trisMesh provided in the Project > Assets > Meshes folder. This will make sure the plane is facing towards the camera. 4. Lets go ahead and add a component to the newly created menu. We will start with the background and work our way to the front. Like all the other shop menus I want the background to have a white plane, a header and footer. To keep everything clean I create an empty game object and put it under UtilitiesShop. I also set its transform to the default values (position and rotation at zero and the scale at one).
5. I now add more empty game objects under the BackgroundGroup and turn them into planes by adding components. For example I create an empty game object named Background_Footer and attach the Plane2trisMesh (located at Project > Assets > Meshes), a Mesh Renderer component and the Background_HeaderFooter material (located at Project > Assets > Textures > UI > Materials). We do the same with more empty game objects and design the Background_Header and BackgroundCollider component. The following screen shots show the final components when they have been set up on the screen.
6. Once youre done with the designing part, check if the menu looks as you intended in the Game window.
You can also do that by double click on Hierarchy > HUDMainGroup to display it in the Editor. Make sure the menu items are facing towards the negative x-axis. The screen shot shows all the menu components that are derived from the UI_Atlas located at Project > Assets > Textures > UI. It also shows the HUD elements in the background (ignore these while designing a menu or disable the HUDMainGroup if these are in the way but make sure to enable it once your done with the menu).
7. Now you need to tell the ShopScript that a new shop menu has been added and to do that add the name of the newly created menu in the ShopMenus prefab.
8. Create a Transform type array to store the transforms of the buttons in the Utilities menu. In this case we only have a back button to take the user back to the Shop Home menu. 9. Create an integer type variable to store the number of buttons.
16. Store the UtilitiesShop menus transform the tMenuTransform array in the start function. This reference is used to make the menu appear in front of the camera and move it away when its not needed. 17. Initialize the transform type array that holds the references of the buttons in the shop utilities menu in the start function.
18. Create a handler function for to define the implementation of its buttons. In our case, we have the back button.
19. Add a new case in the listenerClicks function. This function will call the UtilitiesShop handler function if its button is pressed. Note: The ShowMenu and CloseMenu functions are used to display and hide the required shop menus. These menus input the index of the menu based on the ShopMenu enum.
2. Tap the CostumeItem prefab and add the character material in the ShopCostumeScript from Project > Assets > Textures > Characters > Materials > T_C_Prisoner.
3. Add the character costume texture that you have created for the character. The default ones are placed at the path: Project > Assets > Textures > Characters.
2. Tap the PowerupItem prefab and add a value for Power-up Upgrade Level MAX in the ShopPowerupScript. This variable determines the number of times a power-up can be upgraded. The latest User Documentation can be found at: http://bit.ly/1fIMCdr
3. Add a value for the Upgrade Cost. 4. Select the power-up for which this component has been created.
2. Tap the UtilityItem prefab and add a cost value in the ShopUtilityScript.
2. Tap the IAPItem prefab and add a cost value in the ShopIAPScript. This cost value is the amount of real currency you want to deduct for the purchase. 3. Add the reward value. This is the amount of virtual game currency that will be award on making the in-app purchase.
3. Change the implementation in the Project > Assets > Scripts > EnemyController as needed.
The radio buttons in the in the settings menu can be used to toggle between swipe and gyro controls:
Adding a Power-up
1. Import the .fbx of the asset that you will use as an obstacle. Optimization Notes: - Use Model > Scale Factor to adjust the scale. - Use Model > Mesh Compression to compress the imported asset as much as you can without compromising its appearance. - Select None in Rig > Animation Type if your asset isnt rigged. - Uncheck the Import Animation option in Animations > Import Animation if your asset isnt animated.
4. Add the PowerupScript.js on your power-ups prefab. 5. Set the Powerup Type on the Powerup Script component. 6. Set the Frequency on the Powerup Script component.
7. Drag and drop your newly created power-up prefab to Project > Powerups_Prefabs.
8. New, we have to tell the ElementGenerator script about our newly created power-up so that it will generate the power-up on the path during gameplay. To do that, simply drag and drop the saved prefab to the ElementGenerator script thats a part of the Player prefab. The prefab has to drop in the Powerup Prefabs hierarchy to take effect.
9. Finally delete the power-up prefab from the Hierarchy tab. It does not belong in the scene by default because it is generated programmatically during runtime.
2. Now, you need to introduce the incrementMissionsCount() in the appropriate scripts so that the added mission can be tracked. For this example, we visit the InGameScript because that script is responsible for controlling the game flow, which includes launching, pausing and ending a game. We add this function in the launchGame() function because this function is responsible for beginning a run. Before we do that, we also need to make a variable carrying the reference to the MissionScript. To do that, we follow the example of all the other scripts and add the following lines of code:
Get the reference of the MissionsController in the Start() function. 3. Now we can call the incrementMissionsCount() in the launchGame() function as shown below:
4. From here on its much easier. From the title bar, go to Wizards > Add a New Mission.
5. Add the description of your mission, for example: Launch a new game 5 times. 6. Add the number of time a task has to be performed to complete the mission to the count field. In this case it will be 5. 7. Finally select the type of mission it is. In the current example it will be StartGame. 8. Hit the Add Mission button. A message will be displayed in the console announcing that the mission has been added.
Notes: - The missions are stored in a text file in the Project > Assets > Resources folder. Each mission is stored using three lines. The first line is the mission description, the second is the mission count and the last is the mission type. - To remove a mission, you need to remove the three lines of the particular mission. Be sure to not leave any empty lines, even at the end of the file if you choose to edit it manually.
GlobalAchievementType enum. Following is a code snippet of where the change will be made:
2. Now, you need to introduce the incrementAchievementCount() in the appropriate scripts so that the added achievement can be tracked. For this example, we visit the InGameScript because that script is responsible for controlling the game flow, which includes launching, pausing and ending a game. We add this function in the launchGame() function because this function is responsible for beginning a run. Before we do that, we also need to make a variable carrying the reference to the GlobalAchievementScript. To do that, we follow the example of all the other scripts and add the following lines of code:
Get the reference of the GlobalAchievementsController in the Start() function 3. Now we can call the incrementMissionsCount() in the launchGame() function as shown below:
4. From here on its much easier. From the title bar, go to Wizards > Add a New Achievement.
5. Add the description of your mission, for example: Launch a new game 5 times. 6. Add the number of time a task has to be performed to complete the achievements to the count field. In this case it will be 5. 7. Finally select the type of achievements it is. In the current example it will be StartGame. 8. Hit the Add Achievement button. A message will be displayed on the console announcing that the achievement has been added.
Notes: - The achievements are stored in a text file in the Project > Assets > Resources folder. Each achievement is stored using three lines. The first line is the achievement description, the second is the achievement count and the last is the achievement type. - To remove an achievement, you need to remove the three lines of the particular achievement. Be sure to not leave any empty lines, even at the end of the file if you choose to edit it manually.
Alternatively, if you are using the NGUI Menu, you will have to go to Hierarchy > UI Root (2D)> Shop > CostumesShop > CostumeItemGroup > CostumeItem_x. Check which NGUICostumeItemScript.cs has its Character Material missing.
Alternatively, if you are using the NGUI Menu, you will have to go to Hierarchy > UI Root (2D)> Shop > CostumesShop > CostumeItemGroup > CostumeItem_x. Check which NGUICostumeItemScript.cs has its Character Costume missing.
EXCEPTION: No cost assigned to the costume shop element. Check the user documentation.
This message means that you have not assigned a price to the exposed variable of a CostumeItem. To fix this, go to Hierarchy > MenuGroup > Shop > CostumesShop > CostumeItemGroup > CostumeItem_x. Go through the CostumeItem(s) and check which ShopCostumeItemScript has its price missing or set to zero and change it.
Alternatively, if you are using the NGUI Menu, you will have to go to Hierarchy > UI Root (2D)> Shop > CostumesShop > CostumeItemGroup > CostumeItem_x. Check which NGUICostumeItemScript.cs has its price missing or set to zero and change it.
obstacles currently in front of the player are relocated to the next patch making them disappear suddenly from the screen. To fix this, all you need to do is to increase the number of clones in the pool. The following screen highlights the code in the setPrefabHandlers function in the ElementGenerator script where the number of obstacles to pool is calculated. Lets say the frequency of an element was set to 10; the clones pooled will be 41. The number 4 can be replaced with a higher number to generate more elements.
How do I change the length of the patches to a value other than the default (3000 meters)?
The patches used in the project are 3000 meters by default. 1. To change their length, the first step is to create new patches of the required length in a 3D modeling tool. 2. The second step is to set the checkpoints as explained in the Adding a Patch tutorial. 3. Once you have the patches, you also need to tell the CheckPointsScript the size of the patches to generate. If you skip this step, the patches will be generated after the default (3000 meter) distance. Change the defaultPathLength variable in CheckPointsScript to match the size of your new patches.
well as the Missions Menu. They are programmed to be displayed in sets of three. On completion of one, the next one takes it place.