Sixze/ALS-Refactored

Cannot set default gait to walking.

mmodi3 opened this issue · 1 comments

Desired gait in settings only applies on spawn, after sprinting it always defaults back to the run state.

This is caused by the logic in AAlsCharacterExample::Input_OnSprint(const FInputActionValue& ActionValue)

SetDesiredGait(ActionValue.Get<bool>() ? AlsGaitTags::Sprinting : AlsGaitTags::Running);

Modify the function to use the desired gait instead of the hardcoded AlsGaitTags::Running.

SetDesiredGait(ActionValue.Get<bool>() ? AlsGaitTags::Sprinting : DesiredGait);

This is not an issue, its simply not implemented they way you might think it works. DesiredGait is suppose to represent the Gait you want at a moment in time. If you set it to walking in the settings, and after sprinting it goes back to running, it's simply because the code logically sets the DesiredGait to running when sprinting is over.

See comments regarding this in AAlsCharacter::CalculateMaxAllowedGait() and AAlsCharacter::CalculateActualGait(const FGameplayTag& MaxAllowedGait)

From how the logic is implemented, different criteria of view rotation modes and other stuff can affect which gait you can use at a given time, so even if you set the desired gait to something, it might not be allowed to be used. Just adapt the logic in the 3 functions mentioned above to get the behaviour you want.