Setting Grid Graph parameters at runtime

Hello,

I am currently working on a project where I create Grid Graphs at runtime and I set their parameters then. Following the documentation I have been able to set all the desired parameters through scripts (width, depth, collision layers etc…). However, there is one that I haven’t managed to change, the 2D boolean. I have looked into the documentation, this forum and even the code itself without success.

I am attaching a snapshot of the inspector highlighting the parameter (boolean named “2D”) that I am trying to access through the scripts.

Thank you for your help! :slight_smile:

Hi

You can do that by setting the rotation of the graph:

graph.rotation = new Vector3(-90, 270, 90);

Awesome, that’s exactly what I was looking for. Thank you! :slight_smile:

1 Like