Download

Rep Notify on Bol - Not sure how to work with this

Hi!

So I have been making most of my multiplayer operations run on event via server multicasts, it has been working fine until we did some testing this pas weekend and players login in later on would not see certain changes. I realize now that I need to rework some of the systems to use rep-notifies but I can’t quite wrap my head around it.

I will give you an example I am working on right now. Inside of my BP_Pickup I have two events: one to turn of the physics when picked up and one for turning it on again when dropped. I also have a bol-variable that is used to check if the item is being carried(so only one person at the time can hold it).

My thinking was to use the notify function to switch the physics instead of the events but I don’t understand how to use them. I know they get triggered when the variable changes on the server but I can’t really see how to use them.

So this is the notify function I was thinking but I just want this to happen if the bol is false(not being carried anymore)…


UE4Editor202011181726.png
This is what my event system is right now.

Does anyone have any insight into rep-notifies that could explain this to me? Have a great one!

Okay, So I think I solved it. I wasn’t sure If I could use the variable itself inside of the rep function but It seems to work fine. I just put a branch in there so when the variable changes the function fires and checks on what to do depending on the value of the bol.

This is probably something people have a good grasp on but I thought I would share my solution anyway.