Skip to content

FallingCatch Mantle on low walls or objects #402

@bullet28

Description

@bullet28

Describe the bug
If you collide with an object or wall in flight, then a mantle is applied, but if this wall or object is too low, then when the animation is played, the character's legs fall through the floor. Also Mantle in this situation is rather doubtful from a gameplay point of view.

To Reproduce
Jump and hold W while flying towards wall

Screenshots and Videos
2
3
1

Additional context
I decided to disable mantle for such situations in my project by putting this code between "Step 4" and "Step 5" of the UALSMantleComponent::MantleCheck function

	if (MantleType == EALSMantleType::FallingCatch)
	{
		FVector GroundTraceStart = CapsuleBaseLocation;
		GroundTraceStart.Z = DownTraceLocation.Z;
		FVector GroundTraceEnd = GroundTraceStart;
		GroundTraceEnd.Z -= 70.0f;
		
		const float CapsuleRadius = OwnerCharacter->GetCapsuleComponent()->GetScaledCapsuleRadius();
		const FCollisionShape CapsuleCollisionShape = FCollisionShape::MakeCapsule(CapsuleRadius, CapsuleRadius);
		const bool bHitGround = World->SweepSingleByProfile(HitResult, GroundTraceStart, GroundTraceEnd, FQuat::Identity, MantleObjectDetectionProfile, CapsuleCollisionShape, Params);

		if (bHitGround)
		{
			return false;
		}
	}

Bug & fix results: https://youtu.be/1wKzH5DO1J8

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions