Character always in falling state

Hello,

I found new bug in 4.12 that i did not have in previous versions.

I have Blueprint character class that is derived from c++ character class. When using this blueprint as default ingame pawn than everything is ok.

When creating child class from this blueprint class than my character is in falling state from begin and cant move.

Some additional observations:

  1. When character is spawning from player start the capsule is half inside the floor (see screenshot).
  2. When placing character in the level than capsule is on the floor but still falling state.
  3. I am tried with source version of unreal and reverted CharacterMovementComponent to 4.11. Nothing changed.
  4. I tested Master Branch too. Same Bug.
  5. No Bug on Unreal Tournament version of Unreal Engine
  6. When deriving from this child class one more time and using it as pawn, than everything is ok until Editor restart.

Thanks.

89427-screen.png

Hey Footman-

Just to make sure I understand correctly, you created a class (based on character) and a blueprint based on this class. You then created a second blueprint based on the first? Are you seeing the original blueprint character instance falling or the new child is falling? If you move the character higher(so the collision capsule is fully above ground) do they continue to fall when playing? Can you list steps to reproduce this issue so that I can investigate locally? Additionally, can you provide the C++ class your character is based on?

Thanks for response.

I have following structure:

C++ Character → BP Character → BP Child

Error appears only when using BP Child as my Pawn Class.

That happens only when I am using BP Classes that I created in previous engine versions. When I am creating new BP Character → BP Child in 4.12 than everything is ok. But I have much BP code in my BP Character file and cant just recreate it.

Like I said it happens only on 4.12. Never happened before. So this is some kind of transition 4.11 (started at 4.0) to 4.12 error.
I cant share this files for now because it is part of big project.

Thanks.

Here is constructor of my c++ file. There is nothing special.

    BaseTurnRate = 45.f;
	BaseLookUpRate = 45.f;

    CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
	CameraBoom->SetupAttachment(RootComponent);
    CameraBoom->TargetArmLength = 400.0f;
    CameraBoom->bUsePawnControlRotation = false;
    CameraBoom->bAbsoluteRotation = true;

    NewTargetArmLength = CameraBoom->TargetArmLength;

    FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));
	FollowCamera->SetupAttachment(CameraBoom);
	FollowCamera->bUsePawnControlRotation = false; 

    bFirstPerson = false;

    bUseControllerRotationPitch = false;

    GetCapsuleComponent()->InitCapsuleSize(42.f, 80.0f);

    GetMesh()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);
    GetMesh()->bReceivesDecals = false;

    GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate
    GetCharacterMovement()->JumpZVelocity = 450.f;
    GetCharacterMovement()->AirControl = 0.2f;
    GetCharacterMovement()->bUseControllerDesiredRotation = true;

Just to clarify, did you mean 4.0 or 4.10 when you mentioned the age of the project? Also, was the ChildBP added in 4.11 or 4.12? I tried creating a project from the C++ third person template (which provides a C++ character → blueprint by default). I added a child of the Character BP and set it as my pawn but did not see the behavior you mentioned. Can you let me know if you can reproduce this with the third person template character? If so, please include the steps that reproduced the issue for you.

Project started on 4.0. Child BP were added on 4.3 or something like this. After that project was converted to every new version and had no big issues.
It happens only with these “BP Character” → “BP Child” files that were created earlier and worked well until now.
If i create new BP files from my “C++ Character” in 4.12 than everything is ok. But like i said i cant just migrate this old BP files to new ones.

I also tested to create 3p template on 4.11 and moved to 4.12 and everything was ok. So it is likely something with my BP files that work well on 4.11.

Unreal Tournament Engine version is 4.12 too and there are no problems.

One more thing. only BP Childs are broken. If I create new BP Child class in 4.12 from BP Character than it works.

For me the only solution now is to create new Child BPs and copy all defaults, components, nodes from old. To bad it is not so easy like in c++.

Unfortunately I have not been able to reproduce the problem in a new project either however it sounds like you were able to find a solution that works for you. If you continue to have this issue or need another solution, please send a copy of your project where the problem is occurring so I can investigate the problem directly. For privacy, you can attach the project to a private comment to prevent others from seeing it.

Cheers

I have the same problem. In a singleplayer, the character is spawned above the ground in the falling state for me, and I cannot control it. The problem is worse in networked games, where I get an assertion (this might shed some light on the problem):
=== Critical error: ===
Assertion failed: CharacterOwner->GetRemoteRole() == ROLE_AutonomousProxy [File:D:\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Private\Components\CharacterMovementComponent.cpp] [Line: 6915]

I do not know what is going on but the solution of recreating blueprints is really BAD for me because it would probably take me a month to do so!

do you have custom skeleton like me or default epic one? if yes where is your root bone location?

Yes, I have custom skeleton but my root bone location is placed between the legs (similar to the default epic one). I guess I am not really worried about spawning, and it works correctly in editor also if I use separate processes to start the game. Maybe some initialization code changed the order. Currently, I am doing a fress repackage where I recompiled every class using 4.12 … I will return when I have result if that succeeded.

So, after recompilation, I have the same situation as before: the character is in the falling state on listen server and crashes when I try to conect to the dedicated server with assertion GetRemoteRole() == ROLE_AutonomousProxy.

I am running out of ideas what could be wrong. The character is also spawned above the playerstart (i.e. in air). The role troubles me a lot because as far as I know, it should be autonomous proxy and not (i guess) simulated proxy. Any insight would be greatly appreaciated!

Note that this ONLY happens in packaged builds!

I have additional insights after extensively debugging my server build. The Character class gets initialized but its CharacterMovement component’s CharacterOwner (or PawnOwner) does NOT point to parent class! My hierarchy goes as ClassBase → BP_ClassBase → BP_Fighter for example, and after the fighter is initialized, the character movement component points to Default_BP_ClassBase_C_ (some newly created class I would guess) instead of its parent, BP_Fighter. I have no idea where this could go wrong.

Hey Footman & -

I tried creating another new project but did not see this behavior. Could either of you provide a copy of your project or a sample project that demonstrates the issue? After zipping the project folder you can either attach it to a comment here or upload it to google drive / dropbox and send me a pm on the forums with a download link for privacy.

Ok, so after debugging, I have found out the following: legacy Blueprint hierarchy somehow breaks the CharacterMovementComponent by setting UpdatedComponent in the constructor to a new instance of capsule component (in my case, Default__BaseClass__X). This happens after UpdatedComponent is initialized in the Character. Consequently, the movement component updates incorrect root component and thus the character stays in the falling state. What is more, in networked games, the server obtains incorrect parent (as it checks it from the parent of UpdatedComponent) and the replication yields assertion and exits.

The fix for me is quite simple: in your base blueprint class (BP_BaseClass), I changed the MovementComponent to not AutoRegisterUpdatedComponent (changed the defaults) and in class construction script, I set the UpdatedComponent to the root (capsule component) to overwrite the incorrect change. I do not know which of the settings is responsible for fix because packaging takes too long to check all combinations. All child classes now behave as they did in 4.11.

Well nice debuging work! This solution works for me too. Still epic forgot to update some outdated component references in Character Blueprint after upgrading to 4.12 that causes this error.

one more thing that i saw now: when changing mesh rotation in Base_BP than nothing happens in old Child_BP. In new Child_BP created in 4.12 is everything ok. So the only solution to get rid of all bugs is to create new Child_BP because many things are broken in old one. One more reason to code as much as possible in c++ :slight_smile: