Character settings tab


If you are working in orthographic projection and you have a character in the scene this tab will be available. Through it you will be able to configure the automatic scaling of the character. The entered values will be managed by CharCtrl25dTKOrtho script attached to the character being initialized. You can find this script in the 2.5d Toolkit/Demo/Scripts folder.

We will use the MAINFRAME Demo as an example.

This is the opening scene, with the character initialized:

As can be expected in orthographic projection the character maintains its size throughout the screen:

What we have to do is find two distant reference points to be able to set two different dimensions.

In the case of this image we can consider the fire extinguisher positioned on the central column and the one at the back of the room, between the windows.

Select the Character settings tab.

Let’s start by placing the character near the first fire extinguisher and resizing it.

Use Constrained scale to do this. As indicated by the red line, the character’s arms are at the same height as the fire extinguisher handle.

Click on Save point, in the First point section.

The Second point section will appear.

Now let’s move the character to the bottom, near the second fire extinguisher and resize it in the same way.

Click on Save point in the Second point section.

Done. From now on our character will resize according to these parameters. Try moving it around the screen.

Now you can draw your areas, change the camera settings and whatever changes you make the character will keep these proportions.

Let’s now see in detail how to set the character’s movement. Once you have set the two different heights as described above, create the walkable area.

Select the Navigation tab, click on New walkable area and draw the area as shown.

Now enter Play Mode.

As you can see from the screenshot the area in Scene View appears excessively long compared to how it should be. 

Start by increasing the rotation of the camera to shorten it a little. Stop at 3.

In orthographic projection we do not have the Meter tool available.

Let’s start by establishing how deep our scene is. Let’s assume 18 meters.

In the 2.5dTK inspector we write this value in the Meters field. Considering a step length of approximately 0.65m we obtain from 23 to 33 steps to cover a distance of 18m.

The first thing we need to do is to set the character’s walking speed at the closest point and at the farthest point.

Dragging the character with the right button places it at the beginning of the area on the left. Then click on the opposite point to observe how it walks.

Using the 2.5dTK controls set Closest walk speed. A fair value might be 3.8 (but it depends on the size of your area).

Now drag the character to the bottom of the area and repeat the same thing setting Farthest walk speed.

A good value might be 1.

Now drag the character to the closest point of the area and click at the bottom of it to make the character walk. We immediately realize that after about fifteen steps the character is still too far from the bottom.

The solution is simple: click on View environment from top and slowly rotate the camera. You will see the area shorten. Stop at about 4 and repeat the walking test. This time the character only takes 44 steps to reach the end of the area, but we need to reduce them a little more. After a couple of attempts you will find that with a rotation of 5.2 the character will cross the entire area in 28 steps which is an average value among those suggested.

Now set the running speed in the same way you did for the walking speed. Good values might be 12 and 3.

In the image below you can see in Scene View what the area should look like once the settings are complete.

Remember to click Save scene data before exiting Play Mode to save the changes made and once in Edit Mode to click Load scene data.

The Slow down in the distance option should always be enabled because it slows down the walking speed as the character moves away.

The script attached to the character is a simple script that takes care of resizing the character. When exporting the scene, a similar script will be attached to the character which you will find in the 2.5sToolKit/25dTKTools/Scripts/External use folder. You can improve it and use it in your games but its purpose is to allow you to have an optimal view of your scene. Probably, if you use assets for game creation, you will be able to find much more effective scaling scripts in them.

vbgamestudio
Author: vbgamestudio