Support Forum

GetNodesInRegion on rotated Graph

Hello. I need get nodes in region on rotated GridGraph ! It is possible ? My graph rotated y axis 45.
So i need get nodes in region and respect rotation like if world is rotated 45 degrees, not world position and rotation but local!

Hi

It sounds like you want the overload of GetNodesInRegion that takes an IntRect?
https://arongranberg.com/astar/docs/gridgraph.html#GetNodesInRegion4

new IntRect(x,z,w,h)
x and z its a node count in x and z raw ?

Yes, those are all node counts in the graph.

You can also use GridGraph.transform.* to convert between world space and graph space.
See https://arongranberg.com/astar/docs/graphtransform.html

1 Like