Blend By String please.

All of our animations is weapon driven and so far we have over two dozen and counting and crazy talk to manage by index.

Like a switch would be nice to pass the name as a string cast from the weapon into the blend pose. No index required.

While that would be nice, a little suggestion:
Lets make it an Enum instead of a string. Should be faster to compare. :slight_smile:

I’m pretty sure there is a blend by enum feature already.

There is. See this post: Is it possible to have two Locomotion graphs? - Blueprint Visual Scripting - Unreal Engine Forums

I’ve taken a look see over the list of different blends and all I see are blends that are triggered by a numeric value and not by sting say like a switch by string would do.

What I want to do is to trigger animation based on the current weapon selection we have as part of the players inventory, about 24 so far, and each weapon is given a code name, the M4 is called Penny for example. I/we could assign it an index number as a integer but it would be a lot easier to just grab the code name from the weapon and drop it directly into the AnimGraph. There is already a blend by Boolean and Int so why not String?

An Enum is basically encapsulating an int.
Its members are aliases to natural numbers.
If I have an enum like:
ECards = {Club, Spade, Heart, Diamond}
then you can compare by these “names”.
As they are really integers, you can even use them arithmetically:
Club + Heart = Diamond
Diamond / 2 = Spade

So in your case, create an enum that has about 24 values and use that.
In contrast to a string, an enum offers some more benefits:

  • No typos. As the actual textual name is only stated in the enum definition, no typos or updates at multiple places…
  • Dropdown. Instead of typing a text expression, a value can be selectedfrom a dropdown, at the same time showing a list of all available options…

Because string is more or less inefficient to handle. It has to be compared character by character if checked for identity.
Thats why UE4 has three types of strings.
The Name type is a bit faster as its keeps the strings unique in a global list and uses only references. This way, comparing the references checks for identity quicker, independent of the string length.
See: https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/index.html

LOL welllll your talking to a content creator and code speak is lost on me. Might as well be talking Klingon and the fact that I can do anything in blueprints is more of a testimony of ease of use that even I can make something work.

I guess as long as a blend can accept a string I can figure it out later.

Thanks for the response.