Load player clothing from Game Save

I can not get the child mesh components of my Third Person Character to display when I go into level 2.
These are the steps I’m using: (These steps coincide with the screen grabs, below.)

  1. Clothing are placed as children in the ThirdPersonCharacter Mesh (inherited)
  2. The UMG buttons set the clothing in the ENUM, runs through a Switch on ENUM, then execute the proper function to display the ENUM clothing on Third Person Character (TPC)
  3. Is an example of a function that displays the proper clothing when a button is pressed.
  4. Created a STRUCT with the ENUM categories for Head, Torso, and Legs
  5. Put Struct into Save Game
  6. Put the STRUCT variable into “Game Instance” Save Game function
  7. Put the STRUCT variable into “Game Instance” Load Game function
  8. The “Construct Avatar” function used in Load Game.
  9. Load Game, that runs the “Construct Avatar” function after level 2 opens.
  10. Trying to debug, I can see the player mesh in Level 2, if I plug in a mesh into the Mesh (inherited).
    So, maybe the problem is, a need a function that looks for the children(clothing) of the Mesh(inherited). Then turn, on the appropriate clothing based on the Enums.

This is my goal:

  1. Like most character customization systems, there is an array of buttons for head styles, an array of buttons for the shirt styles, and array of buttons for the pants styles. There will be hats, glasses, hair, backpacks, and other categories.
  2. Click on the appropriate button to see the clothing you want displayed on the character.
  3. The clothing items are child components of the Third Person Character that I will be turning on. The clothing visibility is turned off as a default state. I will turn on the visibility to display the clothing at runtime.
  4. When the player is happy with the clothing choices, all the clothing items will be saved in one variable. Hopefully, that one variable can be stored in Game Save, some kind of STRUCT, or an ENUM. There can be many outfits stored, so maybe I can store the different outfits in a closet.
  5. The game can be turned off, but when the game starts back up, the player can go into his closet to choose the same outfit or a new outfit.
  6. The character will be going between levels, so maybe the clothing can be stored in Game Save or a scene manager.
  7. List itemThere will be a sub set of buttons for Morph targets.
  8. There will be a subset of buttons to change the textures on any piece of clothing.
  9. I’m starting with an array of 3 temp heads, 3 temp torsos, and 3 temp legs:

I can provide screen grabs of any blueprints requested.

Just came across this and noticed something in these screen shots I didn’t before. Do you ever call the “construct avatar” function again when you go to level 2? You realize the game instance is created once and never again. So if you have this function somehow hooked up in a way where it gets called when the game instance is created when you go to level 2 it wouldn’t get called again. And unless you “save/load” each time you go to a new level you wouldn’t get any updates from level 1 showing in level 2 simply by calling this again since it creates your avatar from saved game data. Anyway, just a thought.

Hello I’m not even sure the “Construct Avatar” function is even working. It is assuming the Enums have the correct info in Game Save.
Can I send you a stripped down version of the project?

Yea you can post a link here or to nebulagamesinc@gmail.com whatever you want

Awesome, give me a few days to create the stripped down version. Thanks, man.

  • A good Samaritan (Jonathan) came by and read your suggestion, Nebula.
  • I’m now one step further along…The
    character loads into level 2.
  • Now, I can see I have an infinite loop problem. The first component in each “Switch on Enum” is getting loaded in level 2. When Level 2 loads, it should have loaded the clothing that the player picked in level 1.
  • Here are screen grabs of Jonathan’s fixes.

The infinite loop print comes out when Level 2 loads. Its in the 01_Infinite Loop problem.png.

I’ll try your suggestion, “After level 2 opens, have its level BP get the game instance, cast to your game instance and call the construct avatar function…”
Here is the console:

Have you tried having the level BP call the “construct avatar” function in the game instance? So after level 2 opens, have its level BP get the game instance, cast to your game instance and call the construct avatar function. Also, I don’t know why you have an infinite loop. Where is this print string coming from? I don’t see it in the BPs you posted.