Actor does not replicate properly
Hi, I am working on an online game made with blueprints and i have come across a problem while trying to spawn projectiles from my gun. The single player version works just fine, i spawn the projectile and i adjust some variables in the projectile (such as color, speed, trajectory and stuff like that). For the multiplayer version i tried to create a custom event replicated on server which takes all the values i need and spawns the projectile (which is replicated of course). So as soon as the client (or server) presses the mouse button the run on server function is called but the projectile spawned it's visible just on the server window. The graph above shows what is called as soon as the mouse button is pressed, the spawn on server function is succesfully called on server and it works. The graph above shows the spawn on server function definition where i basically spawn the projectile on the server.
The image above shows the replication options on the Projectile actor that i spawn in the spawn on server function. As you can see everything is properly setted. So the problem here is that with this configuration when two players are connected (one client and one server) the server is going to see his projectiles and the client projectiles while the client wont even see his own projectiles.
Try setting the floats to replicated. I think the server command is just retreiving 0 if the value isn't replicated.
answered Oct 05 '16 at 02:46 PM
Ok sorry not home to look at my blue print that leave on the initial event make the server event run a multicast of the function so all clients run it.
Ie: button -> server -> multicast -> spawn projectile
Though I'd make sure the orojectile is actually set to replicate first
Follow this question
Once you sign in you will be able to subscribe for any updates here