Download

Multiplayer spawning characters

I’m having difficulty getting MP to work properly. The players can’t see each other. They do bump into other other however. I’m not sure the characters are getting spawned into the world correctly. When I start the game from the editor with 2 players, I see that the constructor for the player character is getting called 3 times with Role_Authority. The PostInitializeComponents() routine is also getting called immediately after the constructor, but with Role set to Role_Authority on one and Role_SimulatedProxy on the other two. This is confusing. I would expect that the Character would be spawned on both the server and the client, so there should be 4 calls to the character constructer. (???)

I tried creating a FPS c++ from the project wizard and set it to play 2 characters. It has the same problem. So there’s something that needs to happen in order to make players visible to each other, but I can’t find it. The UT sample code didn’t help much. (There’s too much to root thru.) Could someone point me in the right direction?

[It would be nice if there was a very basic MP-Ready template to start from.]

Are the characters set to Replicate?

:slight_smile: I just logged on to ask exactly the same about a good clear and minimal example for multiplayer, RCPs, remote to server spawning etc. For C++ heavy projects.

I’m currently stuck at this and cant seem to identify where i go wrong.

The FPS template is set to only show the first person arms in the owning game. This means they don’t replicate. This is intentional as the arms floating on another screen would be weird. To get this to work, you need another mesh added to the character with the property set to only show not on the owner game. This will replicate to the other clients.

@csharp1024

That fixed part of the problem. The 3rd person mesh was missing. All the flags were set correctly – it just didn’t have a mesh to show.

Now I just need to figure out how to get projectiles to show up for everyone.