User not logged in
Pure 3d: create a walkable mesh
Quote from vbgamestudio on 14 April 2023, 14:48The goal of the 2.5d Toolkit is to create 2.5d environments, i.e. use a 2d background image behind 3d and/or 2d objects. Syberia 2 or Broken Sword 5 are examples of this.
This mode will only allow camera movement on the x axis and zoom, but it will not be possible to rotate the camera around an object or raise / lower it on the y axis.
However, it is possible to implement workaround to obtain a walkable mesh that adapts to pure 3D.
--
Create a new scene, import 2.5d Toolkit, save the scene and drag the Main Camera into its field.
Leave the other configuration fields at default and drag any background image to the Camera background field. Ignore the warning to set resolution in GameView.
Now open VB25dTK in hierarchy to view children, select VBBgCameraTK and set Culling Mask to Nothing.
Let's imagine that you have to reproduce the streets of a city, with houses, buildings and cars.
Insert one of your objects directly into the Hierarchy, without going through the 2.5d Toolkit controls. Make sure it is visible in GameView.
Set SceneView to Back and drag with the mouse until the red line (near clip plane) overlaps with the yellow line (far clip plane).
Move your object on the y axis until it is placed on the floor. You will have to make the changes from the Inspector because Tools are disabled by default. Note the value of y.
Select the Main Camera and from the Inspector rotate it slowly correcting the y and z values so that your object is always visible in GameView. Stop when you reach a 90 rotation.
Now you can insert all your objects always in the same way, assigning them the noted y value and placing them where you need.
When your top view scene is ready, you can use the 2.5d Toolkit to draw the walkable area with all the non-walkable areas.
Draw your walkable area in GameView, which will likely enclose all of your items.
For non-walkable areas follow these instructions: set the SceneView to top view and drag it with the mouse to have your first object, around which you have to draw a not-walkable area, perpendicular to your eyes. Check "Draw in Scene View" and draw your area. Note that with this feature enabled, you will no longer be able to drag the view in SceneView, so make sure that the entire drawing area is clearly visible. When you're done uncheck "Draw in Scene View".
Drag the SceneView to view your second object perpendicular to your eyes and repeat the steps above.
When everything is ready you can create the mesh. Select the Mesh tab and drag VBAreaTK, child of VB25dTK, into the Area field. Click on "Create Mesh".
Your work is done. The mesh thus created can be used in a 3d game and you can rotate the camera around it or an object in the scene, move the camera on all axes or use it to follow the character.
You can already check it now. Reset the Main Camera by assigning a rotation of, for example, 20, correcting the y and z values to frame the scene in GameView. Import the demo character by dragging it into its field directly from the Project folders, resize it and enter Play Mode. Everything will be ok. Exit, change camera parameters and try again.
Please let us know if this option can be useful for you. In this case we will implement it in the asset.
The goal of the 2.5d Toolkit is to create 2.5d environments, i.e. use a 2d background image behind 3d and/or 2d objects. Syberia 2 or Broken Sword 5 are examples of this.
This mode will only allow camera movement on the x axis and zoom, but it will not be possible to rotate the camera around an object or raise / lower it on the y axis.
However, it is possible to implement workaround to obtain a walkable mesh that adapts to pure 3D.
--
Create a new scene, import 2.5d Toolkit, save the scene and drag the Main Camera into its field.
Leave the other configuration fields at default and drag any background image to the Camera background field. Ignore the warning to set resolution in GameView.
Now open VB25dTK in hierarchy to view children, select VBBgCameraTK and set Culling Mask to Nothing.
Let's imagine that you have to reproduce the streets of a city, with houses, buildings and cars.
Insert one of your objects directly into the Hierarchy, without going through the 2.5d Toolkit controls. Make sure it is visible in GameView.
Set SceneView to Back and drag with the mouse until the red line (near clip plane) overlaps with the yellow line (far clip plane).
Move your object on the y axis until it is placed on the floor. You will have to make the changes from the Inspector because Tools are disabled by default. Note the value of y.
Select the Main Camera and from the Inspector rotate it slowly correcting the y and z values so that your object is always visible in GameView. Stop when you reach a 90 rotation.
Now you can insert all your objects always in the same way, assigning them the noted y value and placing them where you need.
When your top view scene is ready, you can use the 2.5d Toolkit to draw the walkable area with all the non-walkable areas.
Draw your walkable area in GameView, which will likely enclose all of your items.
For non-walkable areas follow these instructions: set the SceneView to top view and drag it with the mouse to have your first object, around which you have to draw a not-walkable area, perpendicular to your eyes. Check "Draw in Scene View" and draw your area. Note that with this feature enabled, you will no longer be able to drag the view in SceneView, so make sure that the entire drawing area is clearly visible. When you're done uncheck "Draw in Scene View".
Drag the SceneView to view your second object perpendicular to your eyes and repeat the steps above.
When everything is ready you can create the mesh. Select the Mesh tab and drag VBAreaTK, child of VB25dTK, into the Area field. Click on "Create Mesh".
Your work is done. The mesh thus created can be used in a 3d game and you can rotate the camera around it or an object in the scene, move the camera on all axes or use it to follow the character.
You can already check it now. Reset the Main Camera by assigning a rotation of, for example, 20, correcting the y and z values to frame the scene in GameView. Import the demo character by dragging it into its field directly from the Project folders, resize it and enter Play Mode. Everything will be ok. Exit, change camera parameters and try again.
Please let us know if this option can be useful for you. In this case we will implement it in the asset.