News Forums RAIN Sample Projects, How To, and Code Chasing player on navmesh

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  prime 7 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34525

    santokki
    Participant

    If I want an enemy to chase the player all over the navmesh even if the player moves behind obstacles, do I just make a Navigation Target the child of the player, and have the enemy AI always moving toward that Navigation Target?

    Is there a better way to do this without using a Navigation Target and just using the player’s transform directly?

    Thank you

    #34526

    prime
    Keymaster

    Sure. Do just what you said - use the player’s transform/game object directly. Variables that contain transforms/game objects are valid move targets for move nodes.

    For example, when you use a sensor and enter a variable name in the Form Variable field, it’s the game object that gets bound.

    #34532

    santokki
    Participant

    Can you clarify? I want the enemy to avoid obstacles.

    It seems using the player’s transform directly doesn’t allow the enemy to chase the player around obstacles. I used the Move action using the player’s transform as the target and the enemy will make a beeline for the player and walk into a brick wall and keep smashing into it forever.

    But if I make a Navigation Target the target, then the enemy will deftly avoid all obstacles to get to the target.

    #34534

    prime
    Keymaster

    Something else must be going on. For RAIN, there’s no difference between the two methods. Do you have a project you can share that demonstrates the problem? Also, are you using the very latest RAIN? (2.1.6)

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

You must be logged in to reply to this topic.