Unity3D navigation solution for 2D platformers using 2D colliders.
This is still early work in progress, it's not advised to use on a production project
In Unity's Packaga Manager add package from git url and use https://github.com/TiagoJSM/2RGuide.git?path=Assets/2RGuide
as the url.
- Builds navigation paths from scene colliders
- Agent to traverse the shortest paths to reach a target position.
- Support for auto generated jumps and drops to connect segments segments
- Support for one way platforms jumps
- Areas that forbid agent to move into to avoid obstacles
- Download the project and open it in Unity3D
- Create a parent
GameObject
to hold other GameObjects with the colliders to represent the world's paths - Add the
NavWorld
component to the parentGameObject
- On the component's inspector panel press bake to generate the navigation segments
- Add
GuideAgent
component to Agent GameObject to andTransformMovement
to move in the navigation segments, if your object requires custom movement replaceTransformMovement
with your ownMonoBehaviour
and consume the data provided byGuideAgent
- To tweat the bake procedure go to
Edit
>Project Settings
>Nav2RGuide Settings
and modify the values to your liking - Add Obstacle component to define obstacle nav segments
- Support for user designed jumps and drops to connect segments
Add TWOR_GUIDE_DEBUG
as preprocessor directive to include additional debug information in editor.
Clipper2 library used to get the world geometry.