Access blueprint from client that is owned by server
this is my setup:
2 player game (1 client, 1 server). The server spawns a character (Character_NPC_Generic) and its default AIController (AIController_NPC). The character is set to replicate but the AI is not (I guess this is reasonable because I only want the server to influence the characters behaviour).
The client player is a ghost that can haunt NPCs. So what I want to do is if the player haunts I want to call a function on every AIController_NPC to check if they are scared. This was my first appraoch: However the "get controller"-node returns none. I guess this is because in the world of the client, the AIController does not exist.
So I figured maybe I have to replicate an event and run it on server. This is how I did it:
This doesn't seem to work either, the event never gets called. I guess the "if owning client"-phrase it, prevents it form fireing since the client does not own the Character_NPC_Generic because it is spawned by the server.
Any suggestions on how to solve my problem? Thanks in advance :-)
asked Sep 12 '14 at 12:05 PM in Blueprint Scripting
AI system is designed so it can only run on server, so anything to do with AI you must do it on server side.
Why don't you just check fear on server side, and send info back to client.
And for any actor to run function on server side, owner of actor must be player controller or a pawn that is controlled by player controller.
answered Sep 12 '14 at 02:15 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here