Mover 2.0 C++ Issue, can't found a parent class "SmoothWalkingMode"

Hello guys, I was tyring to build a Mover 2.0 system form my character using C++, but i noticed that I can just inherit the “SmoothWalkingMode” from blueprint, can’t atually found that C++ to inherit when creating a new C++ class. If i force it inherit from “SmoothWalkingMode’“ by changin the code:
UCLASS(Blueprintable, BlueprintType)
class Project_API UProjectMovementMode : public UWalkingMode
{
GENERATED_BODY()
}

to

UCLASS(Blueprintable, BlueprintType)
class Project_API UProjectMovementMode : public USmoothWalkingMode
{
GENERATED_BODY()
}
it would say can’t open the generate file, is this because the Mover 2.0 still an experimental plugin?

Hey sir!

It’s not because Mover 2.0 is experimental, the error you’re seeing is almost always caused by missing includes and/or missing module dependencies.

Make sure you’ve added the right includes in your .h file.

#include "DefaultMovementSet/Modes/SmoothWalkingMode.h"
#include "DefaultMovementSet/Modes/SmoothWalkingState.h"

I presume you’ve added the Mover dependenci on YourProject.Build.cs

PublicDependencyModuleNames.AddRange(
    new string[]
    {
        "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput",

        "Mover"
    }
);

That should fix the issue.

1 Like

Hello, I’ve just try your way to solve the issue, but I noticed that “SmoothWalkingState.h“ is in the private folder of Mover plugin, so I can’t include “DefaultMovementSet/Modes/SmoothWalkingState.h”, do you know how to fix it?

Oh,

In that case try add only #include "DefaultMovementSet/Modes/SmoothWalkingMode.h" and let see if it gets compiled and also works.

1 Like

Hi, first thanks a lot for your help and return this quick, but I still have some issue when I tried to build it. It’s strange, cause if I change the include from include “DefaultMovementSet/Modes/SmoothWalkingMode.h” to include “DefaultMovementSet/Modes/WalkingMode.h” and
UCLASS(Blueprintable, BlueprintType)
class Project_API UProjectSmoothWalkingMode : public USmoothWalkingMode
{
GENERATED_BODY()
};
to
UCLASS(Blueprintable, BlueprintType)
class Project_API UProjectSmoothWalkingMode : public UWalkingMode
{
GENERATED_BODY()
};
and it works, but I have no idea why

You’re welcome!

This is bad news, SmoothWalkingMode isn’t exposed for C++ extension, only WalkingMode is meant to be extended.

I initially thought it was.

1 Like

NVM, thanks again. I also noticed that “WalkingMode.h“ and “SmoothWalkingMode.h” are in the same folder, just don’t konw why it can’t be used.