News Forums RAIN General Discussion and Troubleshooting Help for Noob PLZ

This topic contains 1 reply, has 2 voices, and was last updated by  Sigil 5 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40124

    brainCase
    Participant

    Hello guys…
    I was trying to use Unity’s native navigation system. But I thought RAIN is (much)better and now I’m studying.
    In unity’s native navigation system, I used ‘Path status’. It can indicate that the calculated path is reachable to the target or not.(But there’s something wrong. So now I’m trying to learn RAIN)
    I want to make Enemy Character to chase the Player only when enemy character is reachable to player. If it is impossible, the enemy should give up chasing and stay Idle.(for example, Player can close a door in a building when enemy is out of it. Or, player can climb to higher place and the enemy doesn’t have climb ability.)

    Is it possible without custom script?
    I read some RAIN API documents and I found ‘IsPartial’ property. But I’m not good at scripting and I need some example or insight…

    So, In this case, how can you guys do?
    (Sorry for my bad English…)

    #40153

    Sigil
    Keymaster

    Sorry for the late reply, I missed this one in my inbox.

    If you want to constrain the AI to a RAIN nav mesh, you can uncheck the “Allow Off Graph Movement” on the Basic Motor (third tab). This will keep the AI from leaving the nav mesh. It will still try to get as close as it can, but once it reaches the point where it would have to leave the move node will return failure, allowing you to clear your target, or play an angry hand wave animation, or whatever you need.

    This is kind of basic as it goes, so if you need a more advanced solution you would need to go to a custom action and check the path’s IsPartial value. If that is the case I can give you a better example.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.