Hello,
is the graphMask still the PRO feature? I am trying to use it with my free version and it does not seem to work. I am trying to create multiple graphs for the same geometry in order to navigate different sized agents. So I would like my agents to be able to choose their graph. Or is there any other standard solution for this task?
Thank you!
Hi
No, it is not a pro only feature anymore.
Make sure you use it as a bitmask and not as a number.
So if you want to make them walk on the 4th graph, don’t write
graphMask = 4;
Instead write
graphMask = 1 << 4;
Hmm, this does not seem to work. I already tried it. My source code is like this:
private int layerMask = 1 << 2; seeker.StartPath(transform.position, target.transform.position, OnPathComplete, layerMask); public void OnPathComplete(Path p) { Debug.Log(p.nnConstraint.graphMask); }
The input is always -1, independent on what I put into layerMask. The path also uses the first graph. When I check your source, this function is called:
public Path StartPath(Path p, OnPathDelegate callback = null, int graphMask = -1) { p.enabledTags = traversableTags.tagsChange; p.tagPenalties = tagPenalties; . . .
graphMask is not mentioned anywhere else in this function. I am using version 3.5.2
Am I missing something?
Additionally, it looks like, my agents do search only the first graph (in the case, when more graphs are overlaping) of the AstarPath component. Is there any setting that enables searching multiple grid graphs?
Alright, I have found the solution for myself. There is one row missing in the version 3.5.2 (and also in the actual beta). I just added this to the 467th row of the Seeker class and it works now:
path.nnConstraint.graphMask = graphMask;
I do not know, if it was a mistake or you omitted this code intentionally (if yes, sorry for hacking your plugin, otherwise it looks like I have found a bug and you are welcome ).
In any case, you made an awesome plugin!
Cheers!
Ah, it turns out it was a leftover from the time when graphMask was a pro only feature.
This is what it says in my code:
#if !AstarFree path.nnConstraint.graphMask = graphMask; #endif
That will be removed when I build the free package.
Thanks for spotting the bug!
No problem. I just moved to pro version so it is also no problem for me any more