multidimensional array; changing one element, sets other elements to 0

I have this save function:

	public void Save(){
		
		
	BinaryFormatter bf= new BinaryFormatter();
	FileStream file = File.Create(Application.persistentDataPath+"/"+profileName+".dat");
	
		
	ProfileData data= new ProfileData();
		
	data.currentCar=CurrentCar;
	data.transmissionMode=TransmissionMode;
	data.speedometerUnit=SpeedometerUnit;
		
	      data.carParts[CurrentCar,0]=currBodykit;
		  data.carParts[CurrentCar,1]=currRim;
		  data.carParts[CurrentCar,2]=currSpoiler;
		  data.carParts[CurrentCar,3]=currPaint;

		 etc.
		
		
		
			
	bf.Serialize(file,data);
	file.Close();
		
	
		
	}

it should only change the values for CurrentCar, but it also sets all other values to zero, so changing settings for one car overwrites the other car’s settings…

My advice, which may seem off-topic, is to avoid multidimensional arrays at all costs. Also using unnamed integers as part indices is the Magic Number antipattern. What you want is a CarData class which has named slots for each possible part. Your savegame then is a list of CarDatas.

[Serializable]
public class CarData
{
    public WheelData frontLeftWheel;
    public WheelData frontRightWheel;
    ...
}

PS: You might want to mark the fields of the saved class as well as the class itself as [Serializable] if not yet.