How can i control an actor in a Networked game?

Hello Everyone,

I am kinda new to networking system and apparently i have bumped into a problem while creating a simple multiplayer game.

Okay here is what i have :-

I have set up number of players to 2,
created a pawn called it player. (set to Replicated and most of the blueprint coding resides in the pawn BP, also default pawn class is set to player in game mode),
placed 2 actors in the world, Gun A and Gun B (these actors are basically guns that shot)

What i want to do is

  1. when i press the button F in Client 1 window, i want Client 1 to Shot Gun A and this should be seen by Client 2
  2. When i press the button F in Client 2 window, i want client 2 to shot Gun B and this should be seen by Client 1

Okay here is the problem that i am facing.

The problem is that bot the client are accessing the same Gun or the same Actor ie:
When i Press the button F in the client 1 window, The client 1 access Gun A and shots it, and this is seen by Client 2 which is exactly what i want
now When i Press the Button F in the Client 2 Window, The client 2 also access Gun A and shots it Where as i want the client 2 to access Gun B and shot it.

Can anyone please help me out in this by letting me know how i could make Client 2 access Gun B ?

Hello,
would really like some help on this, please let me know if someone finds a answer or document or tutorials to this so that i could resolve this issue at the earliest.
Thanks

Hey there,

a direct answer on this would need to be the complete code for your Gun issue. That’s a bit much too ask.

So instead of coding you your solution, I can guide you to resources that might help you understanding networking a bit better.

In the Learn Tab of the Launcher, you can find the Game called Multiplayer Shootout. You might need to scroll down a bit to find it.

http://puu.sh/omgAV/152b6b259f.jpg

You can also download my own Blueprint Network example, but that does not have shooting weapons in it. That’s more for learning how to manage GameStates and spawning Players one after another, waiting for everyone to connect etc. I will still link it (:

You need to scroll down a bit. The Project is called Ball Bump. It’s below the last Youtube Video in my first post:

[Link to my free Projects thread][2]

If you still run into problems with your Replication, then please post a few pictures of your Blueprints. That makes it way easier to see what is going on and what your mistake might be (:

Cheers!

Hi,

Thanks for the reply :slight_smile:

I have checked out multiplayer shootout game and the logic behind it is kinda different for what i am looking in my game therefore its confusing me more :frowning:

Anyways i gonna take a look into your game Ball Bump and check if i can find my solution there. :), if i do not find any solution there i will surely get back to you with some pictures of my gun BP and pawn BP :slight_smile:

Sorry for the delay in reply, its cause i am working on 3 android projects and it gets messy with google developer console being such stupidly complicated :wink:

and also, just to make my question simpler the problem i am facing is "how can client 1 possess gun 1 and client 2 possess gun 2 which are not attached to the characters/ pawns ? "

Thanks for your reply :slight_smile: and can i add you to my friend list in epic launcher ?