1
Vote

Freezing not supported on Vehicles

description

If you enable freezing on the chassis of a vehicle, the inactive vehicle's wheels can spin in place and a fair amount of CPU is wasted. This was preventing me from having cars that are "parked" in my game. I'm not sure if it's ideal, but this fix has worked well for me:
 
In Vehicles/Chassis.cs:
 
public override void AddExternalForces(float dt)
{
if (mCar == null || !mCar.Chassis.Body.IsActive) //###### EDIT 1: Give up on inactive vehicles ######
    return;
 
[...]
 
public override void PostPhysics(float dt)
{
if (mCar == null || !mCar.Chassis.Body.IsActive) //###### EDIT 2: Give up on inactive vehicles ######
    return;

comments