blueprint anim notify and changing sounds depending on the character skin

I have set up an anim notify blueprint for the footprints of my characters and is working no problem. My characters have different skins, some with shoes and some barefoot. Naturally I dont want shoe sound to play if the character is barefoot.

So I am trying to figure how to get the current skin selected (as an enum) from the character into the anim notify blueprint.
Could cast to the character but that would mean casting every time the notify is called which is certainly not ideal.

You will need to use function interface (output eg: EnumSkinChoice) to aovid using casting.
Set your function interface SkinChoice in your characterbp and get your function interface from your animbp.

Ah interfaces … will have to get that set up and implemented everywhere else the skin selection is set up.

If you a parent characterbp, you should be able to have only one custom event setting your skin choice.

I do indeed have a parent character set up, I do have an interface but I did end up implementing it yet.

Can the interface also be used in a savegame blueprint?

In my parent character class I have a skin selection event set up like this

And a load skin event

Not sure how to have these working using the interface though

Yup having your integer skin selection should be fine.

Here an example how you could setup your interface:

BPI function interface

CharacterBP for setting our skin choice

Example how to get the skin choice value

Awesome! Thank you so much!
Going to give this a try! will let you know how it goes

1 Like

implementing it now, but not sure how this will work, Interfaces confuse me.

In the Save Game BP, character BP, skin selection widget BP and the anim notify BP I added the interface like so.
image

and replaced the old skin selection integer with the one from the interface

The implemented interface will be only in Character BP.

Save Game BP - contain only your variable SkinSelection, you won’t need interface here. You will need pass the get skin selection like in my last picture. And set that value to your save game variables.

Character BP - contain your func interface similar to the video and seem fine your last picture.
LoadSkin example:

Am not sure about the widget bp, but it if a menu where you select your skin, you will need to create an input function here as well to set your SkinSelect (from your characterbp)

Anim Notify bp - contain the get skin selection like in my last screenshot.

This is how I choose a skin in the menu at the moment

for the anim Notify bp, you use get player character, but its not a player character I am using, would could I use instead?

Okay, I reverted it. So everything was the same as before, apart from the Character parent BP, which as the interface set like this
image

then loading the skin from save game and setting to the interface variable

finally get skin selection in the anim notify

I have tested this, and currently the variable from the skin selection interface is coming out as 0, even though the skin integer is changed inside of the character

You will need to set the variable coming from the character bp.

Test with a casting first:

Then you can replace the casting with a function interface input event.


It might be better to separate the save system, such that you create an event saveCharacterConfig from your character bp, and only call that event when you autosave or manual save or during exit game.

casting from the widget? There doesnt seem to be a problem with the widget setting the skin and the skin changes properly.

But trying to get the skin interface working from the character to the anim notify.

For now I will have one save system, in the future it may be separated

I really dont know what else to do.
The interface is set. The skin selection changes inside the character.
But inside the anim notify BP, just comes back as 0.

one more time.
Skin interface in the character parent class

set in the parent event graph

that variable is used to set the skin no problem.

but in the anim notify BP, just comes out as 0


even if I make it simple and just have the skin selection set exactly (not plugged in in the shot), still return 0 in the anim notify

could the issue here be that the mesh comp from received notify, which returns the skeletal mesh, should plug into the skin selection target?

These characters are not the player character but the enemy characters, so I cant plug in get player character. any way to get the actor of the skeletal mesh from the mesh comp?

yes the target reference of Skin Selection should be a “get player character” since we implemented our interface to our character bp.

A skeletal mesh represent a component of the the character bp.