I’m new to the networking side of UE4. Sorry in advance ahaha
I am trying to fire my pawn in the forward vector of the camera component.
Currently i have the following in the tick function…
The UpdateForwardVectorServer() is a UFUNCTION(Reliable, Server) and the implementation fires UpdateForwardVectorMultiCast(). This function is a UFUNCTION(Reliable, NetMulticast) and stores the forward vector on the server(i think).
The m_ForwardVector is later used in HitBall() in which is sets the velocity based of this value. However, if i print m_ForwardVector to screen it prints the correct value but when the function fires the m_ForwardVector is set to (1,0,0) which is the default facing direction of the camera?
HitBall() is a UPROPERTY(Reliable, Server) so HitBall_Implementation() is fired server side.
Most likely what is happening is your pawn and camera component are in different positions on the server and client.
You need to ensure the server is getting the forward vector, applying the movement, and then replicating this data back to the client.
Components that are not the root component will not replicate their transform data (even if bComponentReplicates) is set to true.
If you want to set the position both on the client and server. Get the forward vector of the camera component on the server and assign it to the replicated variable. Access this variable on the client to receive the data from the server.
This is the sort of approach you would need replicating VR transform data.