Pathing Tools
Introduction
For the game Plunder's Call (Presented in the previous post) we needed the boat to follow a predefined path during the levels. In order to simplify and to make this task quicker for the designers I decided to create a tool in Unity.
My work
First, I wanted to make a tool that can be reused with other objects than the boat and therefore in other Unity projects, even if the core can be reused on other engines.
As you can see on those pictures, the tool implements Bezier curves to have nice curves that are easy to follow and to make it more realistic in game. Also it is using the Unity Nav mesh to calculate a first version of the path which will let the users to create less waypoints to avoid an obstacles.
In this tool, the waypoints are here to lead the path of course (even if you can let the nav mesh create the path between two waypoints) but also to create different links that can have different kind of data (speed, camera offset and camera dezoom).
Finally, when the object that is following the path is reaching a certain waypoint, it can throw an event with a callback function that can be decided by the user.
Conclusion
This project brings me knowledge in tool development in general but also how to extend the Unity Engine editor. It also allows me to explore mathematic problems such as the Bezier curve and how to make a 3D object following it with his rotation.
0 comments:
Post a Comment