blueprint anim notify and changing sounds depending on the character skin

But the character is not the player character, it is an enemy character. So it would not work?

Ahh i see, then your implemented interface should be in your enemyBP (unless done already)

Try with using a get owner:

Get owner will return the owner of the skeletal mesh which will be your enenmybp actor reference.

thank you for the reply.
Yes the interface is in my enemy BP.

Added the get owner and unfortunately still returning 0

In my setup I store a struct in the character class to define cosmetic settings (CosmeticConfig). Whenever the skin/skeletal mesh changes I update the struct.

Using the character reference in the animBP I can access that config.

Iโ€™m using meta sounds source as a parent for footstep presets.

Using a Data Asset class I assign footstep preset to surface types.

That is an interesting way of doing it! Could give that a try since everything else failed.

Looking over what you sent, there are a few things that are missing I think so I might be able to replicate it properly

I recorded everything here, double check if you have missed anything.

1 Like

Thanks for the video, I have double checked with using the video, and I have the exact same set up, but still returning 0
This is the interface
image

Make a variable inside the interface function in character
image

Set the variable

Inside the anim notfiy BP, get owner and skin selection

Still returning 0
image

I am super confused why this could be happening

Indeed that pretty weird, but it look like it not getting the implemented interface and returning a default value.

Try to test with this:


Expected Result:

Unless it a custom enemy bp that not of type character.

1 Like

Tested with your suggestions.
It does indeed have the interface
image

and the second test looks like its returning how it should, both with the same character BP

I suggest to make a new enemy bp and only test that part of skin selection. Unless it a bug i canโ€™t see where the issue could be.

Otherwise you will have to do casting to your akaneBP in the anim notify.

If I did casting to akaneBP, then it would cast every time there is a anim notify?

Yup, on the 2nd time calling it, it might cost less if it already in the memory but is sure more costly than doing an inferface func especially if there lot of things in it bp.
But it not like you will lose a frame since you are not calling it every frame.

Did you try making a new fresh enemy bp with the interface func, how it went ? :innocent:

1 Like

True, it would be a last resort.
I tried on the player character and works there!
So now I am trying to troubleshoot why not on the enemy classes. Perhaps cause its a child? and needs setting again in the child?

This is interesting โ€ฆ in the child BP the SkinSelection interface is as a function and not interfaces
image

So it is actually working, I tried another character child class and it works! buuuuut just the one akaneBP has the interface as a function. Anyway to return it back to interfaces section?

Hmm then the akaneBP might have been bug out.

Try to remove the implemented interface from it class setting, remove any residue of the function as well if it present.
Then re add the implemented interface from the class setting.

1 Like

Awesome! That worked!

Thank you so much for your help!!

1 Like