Playing Level Crash due to Assertion?

Summary

I am not sure what I have done, I have mostly been working on the BP_ThirdPersonCharacter and since making some changes to my line trace that I have now changed back. My app crashes whenever I go to play the level, it says it has something to do with the GetCapsuleComponent:

Assertion failed: CharacterOwner->GetCapsuleComponent() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\CharacterMoveMovementComponent.cpp] [Line: 7112]

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Other

Steps to Reproduce

Unsure

Expected Result

To play level

Observed Result

Crashes

Platform(s)

Windows 11

Upload an image



it seems like you’ve change the collision from a capsule to a cylinder. maybe that’s the issue.

1 Like

should be fine no? even if its not default char class though
i have made pawn class with no collision capsule etc, just mesh(physics)

just checking what RHI are you using dx12?

the assert will never pass. as GetCapsuleComponent, returns a capsule component. and he has another one. so it will always return nullptr.

which i find super strange how he managed to set up this.

i think it’s just that the movement component is not meant to be used with a setup like that.

character.h

TObjectPtr<UCapsuleComponent> CapsuleComponent;
	FORCEINLINE class UCapsuleComponent* GetCapsuleComponent() const { return CapsuleComponent; }

charactermovement.cpp

ensure(CharacterOwner->GetCapsuleComponent()); // check in FindFloor

no way that will ever return a cylinder. unless i’m missing something. that’s what i get. though i wonder if this is just spam since the op never replied

oh yeah. if hes using it as character class or it inherits from it. “get capsule component” expects it yeah will return null pointer , thats only if he uses that node?
or. is it part of begin play for the internal class to “on possess” from controller ???

he might be using it indirectly. it’s where it crashes.

the component performs logic on its own. and accesses the actor via the “characterowner” pointer.

though i think i’ve made a mistake, epic seems to have decided to name the collision a cylinder. in 5.6 at least.

FName ACharacter::CapsuleComponentName(TEXT(“CollisionCylinder”));
CapsuleComponent = CreateDefaultSubobject(ACharacter::CapsuleComponentName);

i remembered using a different name somehow.

so maybe the root cause is something else. it still crashes due to an invalid capsule component.

maybe it’s calling that function before beginplay? not sure.