Description

AWheeledVehiclePawn class tries to use CCD in the constructor, but

Mesh->BodyInstance.bUseCCD = true

this code does not work to activate CCD because Physics Assets could not be available at this timing. To fix this, CCD activation could be in BeginPlay() like this.

void AWheeledVehiclePawn::BeginPlay()
{
	Super::BeginPlay();
 
	if (GetMesh())
	{
		if (FBodyInstance* BI = GetMesh()->GetBodyInstance())
		{
			const bool bIsKinematic = !BI->IsNonKinematic();
 
			if (!bIsKinematic)
			{
				BI->SetUseCCD(true);
			}
		}
	}
} 
Steps to Reproduce

1. Create a new project with Vehicle template.
2. Go to Outliner and make the mass of Obstacles > Bollards > SM_Cylinders much lighter such as 0.001kg (in Mass property.)
3. Run PIE, hit those cylinders by the vehicle and check the reaction. You do not feel any particular resistances from the collisions.
4. Stop PIE.
5. Open the content browser and open Content > Vehicles > SportsCar > SportsCar_PhysicsAsset.
6. Click Root and tick UseCCD property then save.
7. Run PIE again, hit the cylinders by the vehicle and check the reaction. This time the vehicle looses velocity by the collision.

Note: Currently, Chaos Vehicles have the problem of hitting very lightweight objects that cause deceleration. The above reproduce steps use this problem to prove the existence of CCD deactivation. It means, the Caohs Vehicle is not CCD by default (although code is trying to activate CCD).

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-203581 in the post.

1
Login to Vote

Unresolved
ComponentUE - Simulation - Physics
Affects Versions5.2.15.3.2
Target Fix5.6
CreatedJan 10, 2024
UpdatedOct 25, 2024
View Jira Issue