Advanced Sessions Replication Problem

Hello,

In my third person character I have an ActorComponent parent class. I also have a variable (Power-up) that is a child of that other class I mentioned. Basically, I set that Power-up variable to a child and I have a virtual function so that the childs play their power-up functionality. The thing is that I’m having trouble replicating the functionality of these power-ups because of a dependency and I don’t know how to solve it.


InputAction Power-up is supposed to trigger the power-up function associated with that child class. So, I’m validating that Power-up is valid (because I have a Power-up system that gives you a random power-up after a cooldown so sometimes you don’t have a power-up). Then with Switch Has Authority I call ServerTrigger (Multicast) that calls that Power-up function. here is the problem, when the clients execute this code coming from the multicast, this Power-up variable will be NULL because that variable is from the server, it has nothing to do with the clients It should be independent of the player that uses this input.

What would be the right way to go about this so that I achieve the funcionality that I want? Thanks!

You can send data with the RPC. Create an input variable for the power-up on the ServerTrigger node, and pass in whatever you want. You’ll have to do this with the client node as well.

Thanks for your answer! I guess you mean something like this:


This doesn’t work still because ServerTrigger is Multicast so when a client executes that the input Power-up is NULL