AIPathAlignedToSurface Bug With Custom Gravity

  • A* version: [5.4.6]

  • Unity version: [6000.3.6]

    When Using Custom Gravity in AIPathAlignedToSurface, the moment I have a Rigidbody attached to changes to “Handled By Rigidbody“. The issue is the Rigidbody Gravity is false as I wanted to use the relative surface layer logic. I think this is a bug since it doesn’t make much sense to let the rigidbody take over in this case. Or have I missed something?

I took a look and yeah this looks like it’s by design. I’ll have to tag Aron here to get his thought process and see what we can do here. I’m wondering if there are any ramifications to checking if Gravity is enabled on the Rigidbody.

@tealtxgr thank youfor the response. I appreciate it. I have the pro version of that helps narrow down anything as I know the apis is split. I think the class in question is Pro only but this seems like something that is shared by the base class for everything.

Also, while I have you here - when I call ScanAsync does that work with a yield?

For example, in a coroutine:

yield return astarRef.ScanAsync(graphs);

The above line would asynchronously scan the graphs?

If this should be a new thread let me know.

Thanks in advance.

@tealtxgr Maybe an option in custom like force rigidbody? That way we can use your system but also take advantage of OnTrigger events and etc.

I’m reading the docs on this because I’ve never tried it myself but, from what I’m reading/know already, I’d say it’s at least worth a quick shot and if you run into a specific issue I can take a closer look at the interaction myself. From AstarPath.ScanAsync:

This is a IEnumerable, you can loop through it to get the progress You can scan graphs asyncronously by yielding when you loop through the progress. Note that this does not guarantee a good framerate, but it will allow you to at least show a progress bar during scanning.

I’m not following what you mean exactly by “option in custom” fully.

Sorry for the delay btw, I see you’ve been waiting!

@tealtxgr tealtxgrI mean when a user selects Custom for the gravity there would be a toggle for “ignore rigidbody “

Oh I see, thanks. I’ll go ahead and tag this as a feature request and we’ll see what the developer thinks :+1: Thanks for posting!