# Found bugs

**URL:** <https://forums.unrealengine.com/t/found-bugs/244567>\
**Category:** Plugins\
**Tags:** unreal-engine, UE5-0\
**Created:** [August 9, 2021, 8:25am UTC](https://forums.unrealengine.com/t/found-bugs/244567 "2021-08-09T08:25:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [August 9, 2021, 8:25am UTC](https://forums.unrealengine.com/t/found-bugs/244567/1 "2021-08-09T08:25:57Z")

</div>

In this thread I will post all the bugs I find.

**Engine\Source\Runtime\Experimental\ChaosVehicles\ChaosVehiclesCore\Private\WheelSystem.cpp**

Line 120

```auto
// use slip angle to generate a sideways force
			if (Setup().LateralSlipGraph.IsEmpty())
			{
				float AngleLimit = FMath::DegreesToRadians(8.0f);
				if (SlipAngle > AngleLimit)
				{
					SlipAngle = AngleLimit;
				}
				else if (SlipAngle < AngleLimit)
				{
					SlipAngle = AngleLimit;
				}
				FinalLateralForce = SlipAngle * CorneringStiffness;
			}

```

This is a simple signed limit, but the code is missing two minus signs so actual says

```auto
SlipAngle = AngleLimit;

```

Code should be

```auto
// use slip angle to generate a sideways force
			if (Setup().LateralSlipGraph.IsEmpty())
			{
				float AngleLimit = FMath::DegreesToRadians(8.0f);
				if (SlipAngle > AngleLimit)
				{
					SlipAngle = AngleLimit;
				}
				else if (SlipAngle < -AngleLimit)
				{
					SlipAngle = -AngleLimit;
				}
				FinalLateralForce = SlipAngle * CorneringStiffness ;
			}

```

This code actually looks wrong to me anyway.  
What I am seeing is that once the speed of the vehicle gets above 55KPH, you lose all grip and the vehicle spins out.

---

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [August 12, 2021, 7:58am UTC](https://forums.unrealengine.com/t/found-bugs/244567/2 "2021-08-12T07:58:42Z")

</div>

Another none obvious problem.

In  
Engine\Plugins\Experimental\ChaosVehiclesPlugin\Source\ChaosVehicles\Private\ChaosVehicleMovementComponent.cpp

Around line 280 , you have this code

```auto
    // Work out velocity at each aerofoil before applying any forces so there's no bias on the first ones processed
	for (int AerofoilIdx = 0; AerofoilIdx < PVehicle->Aerofoils.Num(); AerofoilIdx++)
	{
		FVector WorldLocation = VehicleState.VehicleWorldTransform.TransformPosition(PVehicle->GetAerofoil(AerofoilIdx).Setup().Offset * Chaos::MToCmScaling());
		VelocityWorld[AerofoilIdx] = GetWorldVelocityAtPoint(RigidHandle, WorldLocation);
		VelocityLocal[AerofoilIdx] = VehicleState.VehicleWorldTransform.InverseTransformVector(VelocityWorld[AerofoilIdx]);
	}

```

Notice that the offset is multiplied by Chaos::MToCMScaling() , so the value in the setup is not in the standard 1 == 1cm coordinate set

This caused me immense problems as my vehicle accelerated to 30 KPH and then left the planet

---

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [August 13, 2021, 6:03am UTC](https://forums.unrealengine.com/t/found-bugs/244567/4 "2021-08-13T06:03:10Z")

</div>

I am doing this so other coders that have problems have solutions available.

EPIC will be reworking all this code multiple times before UE5 goes live

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a22d3c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a22d3c7](https://forums.unrealengine.com/u/anonymous_user_9a22d3c7)\
**Post date:** [August 18, 2021, 10:18am UTC](https://forums.unrealengine.com/t/found-bugs/244567/6 "2021-08-18T10:18:45Z")

</div>

Hey @PaulBlythe . I also found the same bug + submitted a bug report. On UDN, Epic games confirmed it’s a bug but they have been using the Lateral slip graph instead that overrides that part of the code.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a22d3c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a22d3c7](https://forums.unrealengine.com/u/anonymous_user_9a22d3c7)\
**Post date:** [August 18, 2021, 10:25am UTC](https://forums.unrealengine.com/t/found-bugs/244567/7 "2021-08-18T10:25:25Z")

</div>

I believe I found another bug in the Arcade Control systems( UChaosVehicleSimulation::ApplyTorqueControl) where the wrong “Enabled” flag is used (submitted bug report).  
The code checks the Torque Control Enabled flag and then has another if branch after that checking it again, while it doesn’t check at all the Target Rotation Control flag despite the fact that everything under that branch has to do with parameters defined under the Target Rotation Control section).

So I think the correct code should use the Target Rotation Control “enabled” flag in the 1st if branch.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/1/b188606aa8ac2df42f00e362772582a00950ed34.png)

---

<div class="post-metadata">

**Author:** ![tehKpayne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tehKpayne](https://forums.unrealengine.com/u/tehKpayne)\
**Post date:** [August 23, 2021, 9:52pm UTC](https://forums.unrealengine.com/t/found-bugs/244567/8 "2021-08-23T21:52:10Z")

</div>

> [@anonymous\_user\_9a22d3c7](#):
>
> I also found the same bug + submitted a bug report. On UDN, Epic games confirmed it’s a bug but they have been using the Lateral slip graph instead that overrides that part of the code.

Do you know of any working examples of this? Since the advanced vehicle demo doesn’t use it I’m guessing they’re talking about fortnite or something? I’ve tried using the graph and the other way with Paul’s fix and no matter what I do the wheels lose grip around 50mph as Paul noted.

---

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [August 24, 2021, 6:02am UTC](https://forums.unrealengine.com/t/found-bugs/244567/9 "2021-08-24T06:02:51Z")

</div>

I am still looking into this, one thing you can do in the short term is increase CorneringStiffness massively

I saw in some EPIC test code that they were multiplying it by 10,000 so I tried it and it does have an effect

---

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [August 24, 2021, 6:39am UTC](https://forums.unrealengine.com/t/found-bugs/244567/10 "2021-08-24T06:39:03Z")

</div>

So found out what the problem is, but not the cause yet.

I reinstated the debug displays and did some testing.

When the vehicle is stationary, the down force in the wheels looks … well wrong, but sensible

As you accelerate it decreases and even goes negative, so the vehicle is flying.

No surprise you can’t corner

---

<div class="post-metadata">

**Author:** ![tehKpayne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tehKpayne](https://forums.unrealengine.com/u/tehKpayne)\
**Post date:** [August 24, 2021, 1:55pm UTC](https://forums.unrealengine.com/t/found-bugs/244567/11 "2021-08-24T13:55:20Z")

</div>

That would explain it. No matter how much I increased the frictions it wouldn’t corner, but acts really weird (jerking) while making the contact(s) with the ground. I’ll look around a bit, just short on time the next few days…

---

<div class="post-metadata">

**Author:** ![tehKpayne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tehKpayne](https://forums.unrealengine.com/u/tehKpayne)\
**Post date:** [September 5, 2021, 12:07am UTC](https://forums.unrealengine.com/t/found-bugs/244567/12 "2021-09-05T00:07:15Z")

</div>

I’ve switched to VR land for the meantime, but here’s a few things I’ve checked…

Disabled the forces in the following with no luck.

```
ApplyAerodynamics(DeltaTime);
ApplyAerofoilForces(DeltaTime);
ApplyThrustForces(DeltaTime);
ApplyTorqueControl(DeltaTime, InputData);

```

ApplyAerodynamics was the only one that tried adding a force but it was small and didn’t change anything noticeably when I disabled it.

I turned on the debug visuals but I didn’t see the up forces on the wheels, just lat and long… they did seem clamped around 50mph but I’m not sure if that’s just the debug version or a true clamping of the frictional forces.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a22d3c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a22d3c7](https://forums.unrealengine.com/u/anonymous_user_9a22d3c7)\
**Post date:** [September 10, 2021, 12:53pm UTC](https://forums.unrealengine.com/t/found-bugs/244567/13 "2021-09-10T12:53:37Z")

</div>

I think I found another one but wanted to see what people think. If we have an AWD vehicle and the FrontRear split is e.g 0.5 then I would expect the total Transmission torque to be evenly distributed between all 4 wheels, right? But in the code below it would multiply the total transmission torque by 0.5 (so divide the torque by 2) and then also divides by all wheels. So in the end it’s dividing the torque by 8.

**Example** : Let’s say transmission torque is 100 and front-rear split is 0.5 in an AWD vehicle with all wheels affected by engine. For the front-left wheel we do TransmissionTorque_SplitTorque/ numWheels = 100_0.5/4 = 12.5. I think in that scenario the result should be 25 instead, right\>?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/3/1342ad3bdb32b743ce8092971f0a14e7bbf6f87e.png)

---

<div class="post-metadata">

**Author:** ![PaulBlythe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PaulBlythe](https://forums.unrealengine.com/u/PaulBlythe)\
**Post date:** [September 13, 2021, 10:07am UTC](https://forums.unrealengine.com/t/found-bugs/244567/14 "2021-09-13T10:07:33Z")

</div>

Yes that is a bug.

---

<div class="post-metadata">

**Author:** ![dyanikoglu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dyanikoglu/32/1008648_2.png) [@dyanikoglu](https://forums.unrealengine.com/u/dyanikoglu)\
**Post date:** [September 13, 2021, 11:57am UTC](https://forums.unrealengine.com/t/found-bugs/244567/15 "2021-09-13T11:57:36Z")

</div>

Why you’re not creating pull requests in GitHub? Writing those code pieces here won’t help anyone I believe.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9a22d3c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9a22d3c7](https://forums.unrealengine.com/u/anonymous_user_9a22d3c7)\
**Post date:** [September 13, 2021, 1:52pm UTC](https://forums.unrealengine.com/t/found-bugs/244567/16 "2021-09-13T13:52:42Z")

</div>

I am doing both, but want to get some feedback/ other people’s views on whether something is indeed a bug first.
