First of all
The AI Navigation package
Enabling Gizmos in Game View
The character height must be set correctly in the attached NavMeshAgent component.
You can compile the scene to preview it. The script attached to the character will load the necessary settings from the folder created with Save scene data in the Scene tab. In perspective projection it will only use the walking and running speed, in orthographic projection it will also use other parameters to allow the character to be resized and the speed to be changed as it moves away.
If you have problems building the scene:
“Build path contains project built with Create Visual Studio Solution option, which is incompatible with current build settings”
go to File -> Build settings -> Build and give a new destination path.
According to camera settings you may have difficulty baking the mesh. Furthermore, Unity’s new navigation system locks the Radius to a minimum of 0.05.
To get around these obstacles you can use Navigation (Obsolete).
The position of the yellow horizon line changes according to the settings assigned to the camera (on the Y axis and on the rotation) and to the FOV. The minimum and maximum limits of these settings are handled by 2.5dTK. When there are areas in the scene the horizon must not collide with them.
If you come across this limitation you should know that:
increasing the FOV the horizon lowers, decreasing it the horizon rises, but increasing the rotation the horizon rises and decreasing it the horizon lowers.
So if you need to decrease the rotation but areas in the scene are preventing you from doing so, you simply decrease the FOV enough to see the horizon rise and then you can decrease the rotation. The same trick goes for all combinations.
Note: to draw, you do not need to hold down left mouse button.
- Left click
- Drawing: insert a new vertex.
- Over spot (vertex): select to move
- Right click
- Drawing: show/hide tracking line.
- Over area edge: insert a new vertex.
- Middle click
- Over spot (vertex): remove spot.
- Double click
- Over area edge: select area.
- Outside area edge: deselect area.
- Left click
- [Tab Scene]: (with meter setting enabled) Over area edge: show / hide length.
- [Tab Objects]: move object (while holding the button down, drags it).
- Right click
- [Different tab]: Move character (while holding the button down, drags it).
- [Tab Navigation/Connect vertices]: Over spot: select spot
- [Tab Navigation/Select vertex] Over spot: select spot
Spot and Line radius settings
These are very important settings and you should keep an eye on them constantly if you change the camera settings significantly.
When you hover over an area with the cursor, it lights up. Double-clicking on an edge of it will make it active.
These settings allow you to set the minimum distance for the edges or vertices of the area to react to mouseover.
These settings change depending on whether you’re working in Game View or Scene View.
To work well, keep these ranges large enough, but make sure that when you move the cursor over a vertex, the neighboring one does not light up as well. If two spots are turned on at the same time and you perform an operation like moving or deleting it, it is not guaranteed that the function will be applied to the vertex under the cursor.
Initialize GameObjects in scene
To initialize the objects they must be dragged into their fields from the Project folders. This is because they will be adapted to the needs of 2.5dTK.
For the sprites, a Sphere Collider and the ObjectControl script will be added, needed to manage it with the 25dTK tools.
Two scripts, ObjControl and CharCtrl25dTKPersp or CharCtrl25dTKOrtho, will instead be added to the character.
Once created and set up, to manage them, they will have to be dragged from the Hierarchy into their fields. By dragging the same object from the Project folders we will obtain copies that are all independent of each other.
To create mesh drag VBAreaTK (child of 2.5dTK) into the Area field and click Create mesh. The bottom option Don’t destroy on save lets you decide whether to keep the mesh in your scene or not. You will find the mesh in 2.5d ToolKit/25dTKTools/Scene data/[scene name]/Mesh.
Note: Dragging the main VBAreaTK will result in a single merged mesh consisting of all areas drawn but you can also create individual meshes from each area.
Update: From version 3.1 it is possible to create multilevel environments without using planes.
Using large sprites allows you to work much easier and faster than using small sprites. These sprites are the same size as the background image and you can prepare them using a good graphics program.
When you move the large sprites you will see that it will cover exactly the part of the background image from which it was cropped wherever you move the cursor. You will not need to move it on the X and Y axes but you will only have to refer to the Z axis. Its placement is immediate.
Watch this video to learn more about creating large sprites and placing them (v2 03 – 2 5D Toolkit: A way to place sprite with just a click in one second).
Keep in mind that 2.5d Toolkit has changed since then but the basic steps to create a scene are still the same.
- For all 2D images: select them one by one in Project folders and in Inspector change Texture Type field from Default to Sprite (2D and UI), Sprite Mode: Single, Pivot: Bottom, Read/Write: checked. Apply change (see the settings of the sprites provided in the demos).
- All 2D and 3D objects can be moved away from the floor by setting the Y value (e.g. if you want to hang a picture on the wall or place an object on a table).
- After placing an object remember to click Empty Object or you may unintentionally move it by clicking in the scene.
- Note: contrary to what is shown in the various videos, when you use the 2.5dTK buttons to overlay the sprites on the background image from which you cut them, it is advisable to move them mainly on the X axis and on the Z axis, using the Y axis only if strictly necessary. This is because in this way we will keep the sprites on the same plane as the area that hosts them.
- A 2.5D environment generally does not require a high FOV. Moreover, many images will need camera rotation which with a high FOV will contribute to character distortion on the screen sides.
- To reduce the depth of the scene, increase the rotation of the camera (taking into account the environment where the character moves).
- If there is more than one level or if there are game objects in the scene the camera settings are locked. Define camera settings when working on the base level (the base level can have multiple areas) and insert game objects when the environment is completed.
- In perspective projection use the meter function combined with the number of steps suggested by the script to get a realistic environment. Example: One step generally covers 65/80 centimeters. The character travels a distance of 10 meters with 15 steps. We divide 10 by 0.70 and we get around 14. It is fine. If the number of steps is within the indicated range, that’s fine, otherwise it would be better to look for new settings by changing the camera values.
Areas / Mesh
- When creating areas make sure vertex or edge of one does not touch those of another area.