"Allow Physics Rotation During Root Motion" In cpp

Hello, so I’m using cpp in my project but I’ve run into a beginner problem. My character is still able to partially move when i use root motion. I know how to turn it of in blueprint but im new to cpp and I cant figure out how to make this work in cpp. I’m using ALSv4, the community version, so the MovementComponent uses cpp, with the character. I’ve tried making use of the Chatgpt and Github Copilot, both gave me wrong answers wich is a bit suprising, didnt know it would be this hard for something that is so easy on blueprint. Hope I can get your help!

“Allow Physics Rotation During Root Motion” Is what im trying to do in cpp.


Untitled video - Made with Clipchamp

Hi,

In your character class, simple:

GetCharacterMovement()->bAllowPhysicsRotationDuringAnimRootMotion = false;

Do not forget to add the #include "GameFramework/CharacterMovementComponent.h"

Bye.