Hi, I’m trying to create a task, which is an actor, in the game sort of like Among Us. When I try to give the player control of the input through (PlayerController)->EnableInput(this), the server can gain control of the inputs, but when I try to have the client take the input they never get it. Is there a workflow for handing a client an actors input that I should be using? Also, the actor is server owned if that helps.
You should learn the basics of actor replication before trying this kind of things:
I appreciate the link and I will look it over again. Is there a section in particular you think would help give the playercontroller ownership of the actor? I’ve successfully programmed the weapon system for multiplayer, doors/windows using RPCs, Spawning, Voting with UI integration, so I feel I have somewhat of a decent basic understanding of replication. The problem is I don’t want the playercontroller to possess the task in order to own it in case they are killed while trying to complete it. If there was a way to take ownership without relinquishing the ownership of their player pawn, that would be ideal. I have successfully made it work using RPCs to the object, but I feel like there should be a simpler way, hence trying to use blueprint inputs and take control.
Well, I had to break down and make the task a pawn and possess it to use its controls inside of blueprint. I’m handling the character being killed while not possessing his body by storing the task in the character script and storing the characters original pawn in the task script. When the players UN-possessed body is killed, it checks if the current task isn’t null then calls for the task script to end the task, returning the player to his character. After the player returns to its character, it is then killed and re spawned as a ghost. I was hoping for a solution to give ownership of the item without possessing, but this is what I have working for now. Thanks for the input and if anyone has another solution to control actors without possessing them I’d love to know it.