After upgrading from 4.8 to 4.9, I’ve noticed my Character appears to be falling in the Blueprint viewport (see the screenshot.) Before the engine update he was using the idle animation where he stands, but now he starts to fall when the viewport tab is opened.
The Character Blueprint is based off a C++ class, whose parent class is ACharacter. The base C++ class’s constructor looks like this:
// Set size for collision capsule GetCapsuleComponent()->InitCapsuleSize(50.0f, 100.0f); GetMesh()->SetWorldLocationAndRotation(FVector(0.0f, 0.0f, -100.0f), FRotator(0.0f, 270.0f, 0.0f)); // set our turn rates for input BaseTurnRate = 45.f; BaseLookUpRate = 45.f; // Don't rotate when the controller rotates. Let that just affect the camera. bUseControllerRotationPitch = false; bUseControllerRotationYaw = false; bUseControllerRotationRoll = false; // Configure character movement GetCharacterMovement()->bOrientRotationToMovement = false; // Character moves in the direction of input... GetCharacterMovement()->bUseControllerDesiredRotation = true; GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate GetCharacterMovement()->JumpZVelocity = 600.f; GetCharacterMovement()->AirControl = 0.2f; // Create a camera boom (pulls in towards the player if there is a collision) CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom")); CameraBoom->AttachTo(RootComponent); CameraBoom->TargetArmLength = 300.0f; // The camera follows at this distance behind the character CameraBoom->bUsePawnControlRotation = true; // Rotate the arm based on the controller // Create a follow camera FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera")); FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm // Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character) // are set in the derived blueprint asset named MyCharacter (to avoid direct content references in C++) AutoPossessAI = EAutoPossessAI::PlacedInWorldOrSpawned;
Okay, I did some more testing now. I disabled “Auto Possess AI” in the Blueprint (in other words, invalidated the last line of code in the constructor), reopened the window, and now he’s standing there like he used to. I tried each of the options for that property, and it seems like it only happens when it’s set to “Spawned” or “Placed in World or Spawned”.
I suppose because I’m possessing him with an AI Controller on spawn, he thinks he’s supposed to be falling in the Blueprint editor too. I’m not sure if this is intended or wise - at least to me it’s pretty annoying, but if anyone has a good explanation for it, I’m all ears.
However, I went back to the old commit, the one before the upgrade from 4.8.3 to 4.9, and the same behaviour could be seen there, so I was mistaken in thinking it was because of the upgrade.