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); } } } }
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).
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-203581 in the post.
1 |
Component | UE - Simulation - Physics |
---|---|
Affects Versions | 5.2.1, 5.3.2 |
Target Fix | 5.6 |
Created | Jan 10, 2024 |
---|---|
Updated | Oct 25, 2024 |