The ‘IsProne’ variable is not replicated but it works fine, what’s the difference?
ABP’s ‘IsProne’ also not replicated.
It operates through RPC, so I don’t understand why variables need to be replicated as well.
The ‘IsProne’ variable is not replicated but it works fine, what’s the difference?
ABP’s ‘IsProne’ also not replicated.
It operates through RPC, so I don’t understand why variables need to be replicated as well.
You’re syncing it manually with a multicast.
No, of course you don’t need to do both.
The reason you might replicate it instead is so you don’t need to sync it manually. Clients can just see the value change (repnotify) and respond accordingly (play montage in this case).
the reason we RepNotify over MC is
By calling RPC, the variables are synchronized,
When using Repnotify variables without using RPC, the logic I wrote is executed.
Did I understand this correctly?
Oh, and the replicated variable needs to be run on the server.
And there are two ways to propagate to clients: Multicast and RepNotify, right?
correct, set the variable on server with notify, this will automatically create an OnRep function. inside that function call any logic you may need.
not to confuse things further but you have an interesting case
the Montage could be Multicast since its a non-essential event but that IsProne state needs to be replicated.
the difference is, if a player joins late or becomes relevant late, do you want the actor to player the montage or just already be in the prone state.
Not sure I understand your new questions properly sorry, but this is my best effort based on what I think you mean:
If you replicate the variable you would need to adjust things, Prone_Server
should obviously not call Prone_Multi
, and should instead just set the variable. Then instead of Prone_Multi,
you would do the Is Prone
check and montage playing in the repnotify function, but with montages swapped around (because you are reading the just updated Is Prone
now). Of course, drop the delay and sets.
The variable needs to change on the server to be replicated, yes. So the Server RPC is essential, replication is a one way street (Server → Clients), getting the server to do something a client wants always needs an RPC.
The point Auran just raised is the ‘killer application’ here I think, by doing this with a multicast anyone who comes along later will see you prone character standing, because they never got the multicast; using replication the engine will take care of all (in this case, replicating the changed values to the newcomer immediately).
Thank you both!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.