Runtime Scene Setting

Hello!
If my scene is completely created at runtime,So how can I choose the Graph type?And is there a example scene or tutorial?Thank U!

Hi

Here is a screenshot of a tutorial that will be included in the next version of the package.

Thanks!
when will the next version be released?

Nothing decided yet. Everything in that tutorial works in the current version however (and several versions back), it’s only the tutorial that’s new.

This is a good news! May you give me a url address instead of screenshot?
Thank U! download done!

Hi

There’s no URL yet because the new version is not released yet. That’s why I posted a screenshot.

You mean create a script(in empty gameobj) like what you posted in the scene,the A star pathing alg will work?

Yes, though you will need to add the AstarPath component to some GameObject first (but you don’t need to add any graphs).

OK,I created a script
void Start ()
{

AstarData data = AstarPath.active.data;

GridGraph gg = data.AddGraph(typeof(GridGraph)) as GridGraph;

} in a empty gameobj.
A* gameobj(including astar path scrpt and graph is empty ),
Bot who has AI des Setter script and the target is a sphere.
But, the bot can not move to the sphere position.Why?
Thank U!

Hi

Please read the page. You probably want to set some values for the graph and then scan it, otherwise it will not be usable.

thank U!
so I changed the script
void Start ()
{

AstarData data = AstarPath.active.data;

GridGraph gg = data.AddGraph(typeof(GridGraph)) as GridGraph;

int width = 500;
int depth = 500;
float nodeSize = 1;

gg.center = new Vector3(0, 0 0);

gg.SetDimensions(width,depth,nodeSize);

AstarPath.active.Scan();

}
But the Bot still not work?

the normal and warning message is
Scanning - Process took 406 ms to complete
Path Failed : Computation Time 0.00 ms Searched Nodes 0

Well, how does the graph look?

No, I mean the visualized grid graph. Do you think you could post a screenshot?

Thank U! I have posted!And how to see the visualized grid graph?

Hi

Using the ‘Show Graphs’ toggle on the AstarPath object. Have you read the get started guide/watched the video? https://arongranberg.com/astar/docs/getstarted.php

Yes, the ‘Show Graphs’ toggle is on!
my void start() content has tested in your scene?
Compare to example Scene ,i have not seen grids when using the runtimeXX script…