When im testing multiplayer projectile spawn from weapon muzzle, it works on normal run where one of players act as server, but if i check “run on dedicated server” to true, it cause problems with socket location, it spawning projectiles from one location…
Can you show me a screenshot of your blueprint for the firing mechanism? Additionally, try running a print string on the relative socket location, is it different on PIE when Run Dedicated Server is on/off?
I tried print string on relative location and it returned 0 0 0 for both cases (im spawning and attaching gun at begin play), also tried world location, and both cases returns same numbers so it looks like socket location is not changed with dedicated server option
Try using a “User timer by event” and set the event input to the timer function you are currently using. I ran into a similar issue last week and this seemed to be the cause.
Hello, I tried but i still have same problem… This looks like a very deep bug… If you want i can send you my whole project and you can test it out, let me know… Thanks
I did one more test: 1 player and run on dedicated server:
Socket location in print string is changed (got X values between 1750 - 1800 - 1750 so its mean that socket is moving on curve as expected
but projectiles are spawned from one same point… Strange is that i can rotate horizontally that spawn, but not vertically like in video…
So i did more tests and i found that it is not only socket location problem…
In weapon blueprint, i created st.mesh component and attached it to gun at muzzle location
Try creating a rotation variable input on your custom event. Pass the rotation and location information through this. It may be that the socket information isn’t being updated to the clients properly because the data is local, not server data.
perfect! so i SOLVED this!
Thank you a lot , so for future googling for other people:
First i calculated spawn transform on client (in bp without any replication) and then i passed it to server to spawn projectile and it works.
Btw only last question, is this “bug”(dedicated server option) or it was my mistake by bad BP setup?
Unfortunately I don’t have a good answer for that. Depending on the setup it could have been as simple as a missing value or the server needing specific information to be passed through. I am happy to hear that it is working and will mark this as answered for tracking purposes.
(UE4.15.2) Just to help anyone having trouble with this in the future. Best than asking the client to send the position is to actually use the position of the socket on the Server to prevent cheating. The thing is, Dedicated servers don’t render the meshes, so skeletal meshes do not update their sockets or bones while not being rendered by default on the server part.
But there is this magic flag that allows you to set the skeletal meshes to actually refresh bones on update even when they are not rendered, just click on your Skeletal mesh component and scroll down to:
And these are the options, the first one is the one that allows you to do calculations without rendering…