Hi,
I am trying to understand how to make instantiated prefabs “walkable” on a recast graph at runtime.
I am instantiating these tile prefabs at runtime which make up floors and walls, stairs, etc. on a recast graph built at editor time based on a terrain. Carving works great, when placing, but making new walkable paths does not want to work.
Each of these walkable parts have a child GameObject with a BoxCollider which has a RecastMeshObject Component and the following script.
public class UpdateGraph : MonoBehaviour
{
private void OnEnable()
{
// As an example, use the bounding box from the attached collider
Bounds bounds = GetComponent<Collider>().bounds;
var guo = new GraphUpdateObject(bounds);
AstarPath.active.UpdateGraphs(guo);
}
}
I am getting disconnected graph tiles(?) as seen in the screenshot and I am sure that i am just missing something here.
How would you approach this tile based update to a recast graph (at runtime)
Thank you all for your help!