Hello,
I’m trying to do a partial grid graph update on a gameobject. The point is to update the graph around the object whenever it’s moved by physics forces:
Bounds bounds;
Rigidbody rb;
// Start is called before the first frame update
void Start()
{
bounds = GetComponent<Collider>().bounds;
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
if(rb.velocity.magnitude > .2f){
var guo = new GraphUpdateObject(bounds);
// Set some settings
guo.updatePhysics = true;
AstarPath.active.UpdateGraphs (guo);
}
}
However, it doesn’t update the graph. Is it possible to do this frequently in the Update() function?
Thanks