AttachToComponent and Replication
So I have a weird behaviour with Unreal's Multiplayer, more specifically with actor replication.
I started from the third person template and what I wanted to do was spawn a blueprint class from my character's BeginPlay method and attach it to the character, as the server is the only one that should spawn important objects I did it like this :
Now the AShape class as these lines in his constructor :
Then as you see in the code above (the SpawnSphere Method) I call a function that is called AttachSphere and is like that :
Now this is what I get on the server :
Which is perfectly fine but on the client I have this :
The Spheres are absolutely not in the right place I've searched for long hours I found a post where people said that I should use AttachToComponent on the server and on the clients which I tried to do with the NetMulticast function but I can't get it working.
If any information is missing please tell me,
asked Feb 24 '17 at 01:38 AM in C++ Programming
You don't need to run a multicast, as long as the Sphere is replicated you can simply in the server spawn and attach the sphere and that will be replicated automatically to all clients. Keep your code as it but make AttachSphere() a normal function that runs on server only, with sphere been replicated.
answered Oct 08 '17 at 07:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here