Change Skeletal Mesh by UMG

Hi, So I am trying to make UMG where will be select character. But it is not working do anyone know what is the problem? Both telling me ERROR. This is the blueprint:

UMG blueprint:

Character blueprint:
There is 2 Functions which change skeletal mesh both are same as this one!

HELP PLEASE!

if theyre printing error then your character is not the MaleCharacter blueprint. Are you using a different pawn or character when your in the selection screen? If so that is the player character. OR if your Male character blueprint is a Pawn and not a Character, that will also print error

The UMG where I select character is MainMenu just when you open game. So I made GameMode and PlayerControllerClass, this is the blueprint:

your casts are failing because as vice said your character is not of the male character class. in picture one the on click event happens right when you click the button so it is happening while still in the menu game mode. in the menu game mode your have the default pawn class set to default pawn which does not inherit from the malecharacter class and as such will always fail.

what i would suggest would be to create a custom game instance with a character class variable. then for your on clicked event save the type of character you want to the character class variable in the game instance. then when you actually begin the game and switch game mode, have your new game mode read the characterclass variable and set the default pawn class.

below you will find a picture showing what i was talking about in the last posts second paragraph. its a bit more shuffling of information but its a pretty simple process.

also the second picture im posting uses a similar methodology but instead of setting the entire character you just set the mesh. with this method though instead of setting the default class in the game mode you would just set the skeletal mesh for the character in the player controller. this one may or may not need to be called on each respawn of the player.