I have a character selection Screen for Metahumans, please see below. When user starts game for first time they are brought to this level to choose their Avatar. Each of the 8 characters are Metahuman BP characters. When the user chooses a character and clicks on pic, they are taken to new level and start that level with the chosen character. I have created the Widget BP for hovering and choosing character and a new level loads when I choose a character, but how do I make it so the new level starts with the chosen character and all subsequent levels after that will play with the chosen character. Must I make a character BP in every level I want the chosen character to appear in. What would the code look like in this Character BP so when the new level starts the character I chose will appear. Any help would be great thanks
Must I also add code to every Level Blueprint I want the chosen character to appear in?
You need to save the character type in either the game instance, or the save game. When the new level starts, you get the character type from there, and spawn it, and possess it.
The problem with using the game instance, is that when the player restarts the ‘game’, everything will be lost, so the save game is superior in that respect.
That’s why you do not script something like this in the LB.
- script it in an actor and add that actor to any level you need
- or script it in a framework class directly
- or script it in actor and add that actor to a framework class as a child actor component
And yeah, save games.
Thanks but I dont want to give options for player to save game. This is an Archviz Metaverse where customers choose an avatar at beginning then can walk around with that avatar, its more of a demo. I just need the user to be able to choose 1 of 8 avatars and then they can use that avatar in every level during the demo walkaround. Do I need a character BP in every level which calls the chosen character everytime the level starts?
Save Game really just means save data - you’d probably just need to save a single variable - int. You need to save which avatar they’re using because when you load a new level everything is wiped, so to speak.
Alternatively, you could store this information in the Game Instance (that persists) instead but if you restart the project, the selection will need to be done again. If you do not care about data persistence between sessions, the GI is probably enough.
Thanks
I know how to load with selected character - do you know if you can help me with the metahuman character selection pls?
Yeah, I havent looked at this in a while, but I can find the old project and let you know how I set it up, but it still doesnt work. Let me know.