Well, in my game, each player has a lot of saved variables like race and name. But in a multiplayer session, the “load variables from saved games” function loads for every player with the local save of who is playing.
This function is associated with the Begin Play event.
Hey buddy, there was a lot of time since you answered this, sorry for not replying. So, I tried what you suggested and I think we’ve made some progress. I created a blank project to test it out and look the results:
In this project, the player can choose between two colors for his head: Green and Red.
I’ve managed to put the blue color where no information is provided to load. So, if the player head is blue, that means that his material wasn’t loaded from the save.
The server sees everyone with the same head color as him and the client sees everyone with a blue head, which means that event of overriding colors didn’t worked / didn’t was executed at least in his game.
Really your article is very helpful for me I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
Basically, each local PlayerController reads its color preference from a local save file, and then tells the server what that color is.
The server gets the color the player wants, and then sets a RepNotify variable.
Inside the RepNotify function (not shown in image) you find your Pawn material and change it to the new color.
Notes:
The reason I did this with the PlayerController BeingPlay is that the GameMode class only exists on the server, so sadly, the handy OnPostLogin function is not available to remote players who join the game. However, if you don’t want to use BeingPlay you could create a custom Multicast event called MyPostLogin in the PlayerController, and have the server call that every time a Player logs in.
One thing to be aware of is that Players joining a game is like this: PlayerController Spawns → a little bit of time passes - > Pawn Spawns → a little bit of time passes → PlayerController Possess Pawn. This means you have to be careful because during the BeginPlay for the Pawn and PlayerController, the PlayerController and Pawn are not connected yet (i.e. the Pawn possession has not occurred yet). A quick hack is to use a delay node to wait a little bit for this to happen.
The OnPossess event is super handy, and seems like it would avoid the need for that delay node, but is sadly only called on the server. Again, you could always create a custom Multicast “MyOnPawnPossess” and do it that way to avoid the delay node.
How to make money! Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
How to make money! Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
Welcome to our site. Thank you for Visiting our site.
I hope you love this site and you can find each and every thing about Poetry which you want , If you have any issue you can contact us.Thanks for giving your valuable time https://www.urdulovelyshayari.com/
Exclusive access to the best Online IAS coaching material. We are known to be the best website for Best Online Coaching for UPSC examination. Get the best online IAS coaching options, mock tests, interview guidance and support services here. The best learning materials that promise success in the UPSC IAS examinations and best Coaching experience.
I provide the details related Apple iPhone 11 Pro. I tell the details related to Camera Specification, RAM and ROM details, Performance details and also Main details.