Hello,
sorry if the question might have a obvious answer, but I am a starter in Unity and not quite used to it.
I have a simple plane with a Unit which i can send around. Everytime I order the unit to a new point, I update the seekers target position, which workes fine.
But if I instantiate a new prefab object (which has a collider component), the path of the unit is not updated and he runs infront of the object and stops there/trys to run into it, but due to the collision he can’t.
After creating the new obstacle, I call
AstarPath.active.UpdateGraphs (obstacle.collider.bounds);
and the Unit has
`
public void OnEnable () {
AstarPath.OnGraphsUpdated += RecalculatePath;
}
public void RecalculatePath ( AstarPath ap ) {
seeker.StartPath (transform.position,targetPosition, OnPathComplete);
}`
But somehow the graph isn’t updated as it should be. When i press Strg+Alt+S in the Scene-View though, it detects the new objects.
How excatly do i have to update the graph? I already tried some layer-settings, but it still doesnt work.