Update Graph

Hi there i am busy looking to update my graph for when i place a new tower for a TD game, Thing is i am able to update the path but my objects will be pushed by other NPC’S or objects. I found out that what i am doing is a mistake and i am wandering if someone can point me in the right direction. Here is what i am doing wrong

"The GraphUpdateObject::updatePhysics variable matters a lot when updating grid graphs. If it is set to true, all nodes affected will have their height recalculated and then checked if they are still walkable. You usually want to leave this to true when updating a grid graph.

A common misstake is to create a new obstacle in the scene, and do something like this:

GameObject obstacle = GameObject.Instantiate (obstaclePrefab,somePosition,Quaternion.identity) as GameObject;
AstarPath.active.UpdateGraphs (obstacle.collider.bounds);

And expect the area under the obstacle to become unwalkable. The misstake is often that one does not check that the obstacle is in a layer which would make the nodes unwalkable in the first place. The GridGraph’s settings for collision checking has a mask field, one must make sure the obstacle is in a layer contained in that mask."

I need to update my path and do it the proper way but i cant find a pointer or anything.

I am doing this

public void UpdatePath() {

The solution to what is described in the quote is simply to make sure that your tower object is in the correct layer, usually you set it on the prefab (if it is a prefab) in the editor.

I have done that, The thing is when the player touches this object it moves even though it has nothing telling it to move at all, It should be a static object. I even attached a rigid body and restricted it’s movement on all axis and rotations

Sorry, I do not follow. Could you elaborate?