AI chase player in multiplayer mode(plis help)

I have artificial intelligence made to chase players, but in multiplayer it doesn’t work, just chasing the host

  1. I tried to get the player’s index, but what ends up not working

  2. After that I send to the behavior to get the player’s index as well as in the images below



  3. it returns only the index of the server and does not take the client “0”

How can I fix this?

Hi, in your images you set the “Player Index” variable to 0, on the server that’s always gonna be the server.

But why not just using a new blackboard key something like “Target Actor” and use that? So you would set that when the AI sees a new player with the reference of the sensed actor. Then you don’t need this workaround with the player index.

1 Like

For those who are having the same issue, setting the target actor that you will create in the behavior tree/blackboard to the actor that the AI perceived fixed the AI, preventing it from following only the server and having it follow server and the client as well