When I run on server to spawn an actor the return value is valid fine.
But not for client that return to none or invalid
This is what I have tried
1.set variable to replicate(not work)
2.set actor to replicate(not work)
3.execute return value and run on client event(not work)
I’m now on searching but still havn’t found any clues.
I have searched for a long time then I can now finally solve it!
Took me to watch all over 50+ videos.
I try to spawn character and change material from my player controller and there is no way to replicate the return variable after spawned.
The solution is:
You need to transfer all spawn mechanic to gamemode with executed event spawn(with default) and variables to store ref character and ref material with replicate
In player controller create event(replicate to server) and excute to cast to gamemode then to gamemode event spawn(material variable to replicate at player controller must plug through event to event untill to store variable)
Create game state and create event(multi replicates) to set material
Inside gamemode create 2 events after that put to back of spawn mechanic
1.event to server(default) this is set material event and it is easy to do it
2.event(replicate to client) and execute
cast ro game state and to game state event set material, Ref character and ref material must go through event to event
You can simply have the Authoritative Proxy Spawn the BP_ball. Ball needs to be set to Replicate.
The Material (skin) requires a reference variable set to Rep_notify.
In the OnRep function you use the value of the variable to Set the material.
Create an event in BP_Ball to change the material. On client change → RPC server to set the value. Server set the rep_notify variable to the new value. It then gets changed on your end via the OnRep function.