Demo CABLEWAY Orthographic
First of all
We need to establish some dimensions, dimensions that we will have to maintain during the creation of the environment.
We can refer to objects present in the background image, which we know have a certain size, but we can also use the height of the character. Its height in meters is defined by the Nav Mesh Agent component, but you can see it directly in the Scene tab.
Let's set the size of the character
According to your needs, you can set the character scaling whenever you want. Since we will be using this as a reference, it will be the first thing to do.
Nico’s image will come in handy.
Move to the Character resizing tab. Move the character closer to Nico and scale it.
Click Save point in the First point section. The Second point section will appear.
Move the character to the farthest point of the area, resize it, and click Save point. Use zoom in Game View to see better.
Now drag the character around the scene and you will see that it will be automatically resized. By bringing it to the closest point, in contact with the railing, we can make sure that its proportion is correct with respect to the railing itself. The white bands on the sides are always at the level of the handrail, both at the closest and furthest point.
The Character resize tab once set:
Let's analyze the environment
From a first glance, it is clear that the railing will guide us in establishing the measurements. It covers the entire length of the walking area and will be of great help.
Let’s position the character as in the figure then rotate it on the z axis
The character covers the entire empty space, which we can evaluate as 1.70m, i.e. the height of the character.
Let’s keep in mind that this is a drawing, these will be approximate measurements for us, but very useful for establishing the length of the area. Let’s now count the empty spaces of the railing in the longest part: 8 plus the width of the bridge. Let’s say 9 spaces which we will multiply by 1.70. The total length will therefore be around 15 metres.
Now that we have a measurement to build on, we can begin to build the environment.
Building the environment
In the Scene tab, under the Character section, we find these fields:
Step length, by default set to 0.65. It represents the length of our character’s step. You can change it according to your needs.
Meters, here you must enter the length of the area you calculated previously, in this case 15.
Numbers of steps, will give you the number of steps that the character will have to take according to the previous parameters.
Let’s go to the Navigation tab and draw the area as shown in the figure:
As you can see, at the farthest point we have stretched the area. This will be useful because, in orthogonal projection, we will have to define the walking and running speed, both at the closest point and at the farthest point. These parameters are required to slow down the character’s speed as it moves away from us.
Now enter Play Mode. The area will automatically be baked.
You will notice that with a default rotation of 1 the character walks very slowly.
Not having the Meter, a tool available only in perspective projection, we will have to work on the number of steps of the character.
In orthographic projection, a small change in camera rotation is enough to change the length of the area considerably.
Let’s bring the rotation to 3 and we will see that the character’s walking will improve noticeably. However, it is still too little. We set a rotation of 10 and try walking here and there again, always staying at the point closest to us. Goes better. Note that the area will be baked every time you click to make the character move after changing the camera values.
Now that at the point closest to us the character moves well with a speed set by default to 1 in the Set Character movement section in the Closest walk speed field (but you can change it according to your needs), move the character to the bottom of the area and do it walk.
The walk is too fast. Set the Farthest walk speed field to 0.5 and try again. Good.
Now move the character to the closest point of the area and click at the bottom, to make it travel all the way. Count the steps.
With a rotation of 10 the character takes about 45 steps, which is too many. In the Inspector we can see that the suggested steps are between 19 and 27.
Let’s increase the camera rotation until we get this result. With a rotation of 18.5 the character takes 25 steps, which is fine.
Now set the running speed as you did for the walking speed. Good values might be 3 for Closest run speed and 1.5 for Farthest run speed.
Remember to save before exiting Play Mode
When you have completed your work, click on the Save scene data button before exiting Play Mode. As soon as you return to Edit Mode, click the Load scene data button.
Adjust the far vertex of the area and now you can proceed to insert the two sprites cut out from the background.
For detailed instructions on placing sprites, see Demo NICOHOME Perspective