Undesired Behavior: Character teleports when floor standing on teleports

  • Character standing on a dynamic object.
  • Dynamic object gets teleported or location set(not swept)
  • The player sweeps with the path.

I reproduced the bug in a blank project, downloadable from dropbox here.

I also recorded this video demo of the problem, can be watched

I was able to find a workaround to this problem after combing through the CharacterMovementComponent code.

The undesired behaviour comes from this part of the code. Which is responsible for moving the character with the floor it is standing on. This is a useful feature for when the character is on a moving platform.

Because I didn’t want to have to modify the engine and run on a custom build where this code is can be gated by a boolean. My workaround is clearing out the character’s stored floor reference.

However, because the function I want to call is public and not BlueprintCallable, I wrote a static function in my library to make the call.

// .h
UFUNCTION(BlueprintCallable) static void ClearCharacterFloor(ACharacter* Character);

// .cpp
void UDaakorunFunctionLibrary::ClearCharacterFloor(ACharacter* Character)
{
	Character->SetBase(nullptr, NAME_None, true);
}