4.11 - C++ Characters crashing on SetSkeletalMesh

Additional Info:

  • Checking my last version PCIP is a
    FObjectInitializer, I just kept the
    variable name to “write less”, but I
    did changed to ObjectInitializer
    without any change on the crash.

  • Checking the 4.11 ACharacter class I
    have seen that “Mesh” is now
    referenced on a lot of methods
    (FindComponentByClass,
    PostInitialize, Possessed,
    Unpossessed, GetRootMotionAnim) so I
    thought about make a compile
    “without” the donotcreate directive -
    Crash stills.

  • I have tried to “override” the
    methods that references Mesh
    directly, but some can’t be overriden
    (GetRootMotionAnim is not detected on
    parent classes, the own GetMesh( ) if
    overridable would easily “redirect”
    the return to one of my components
    (the root animated one) and ease a
    transition.

  • One detail that got my attention was
    that keeping “exactly” my old code
    and calling SetSkeletalMesh just on
    the headMSHcomponent (the first
    created and declared) doesn’t crash
    the game neither the editor, but on
    try setting any further added
    component causes the crash.

  • Regarding the above issue, until
    seting “the same asset” to them still
    causes the crash.

  • Trying to make the CharacterClass
    (regarding components) through
    Blueprints (getting a ACharacter as
    parent and adding a
    skeletalmeshcomponent) works
    perfectly and doesn’t crash the game
    or the engine. This is getting me
    crazy since all my components are
    declared and created in the same way
    shown on the original ACharacter
    class code.

The “shorter” path would be create a child from SkeletalMeshComponent and fix the crashing assert trying to override SetRootBodyIndex( ), but the simple curiosity in know what is going on and the unknown future consequences on maybe being bypassing a serious bug is driving me crazy.

Any help will be really appreciated.