"CarTutorial" of Unity 3d

Hi guys,

I already post this, but with little changes.

How to put brake and backward lights in “AlternatePhysicsModel”?

And how to put a speedometer with pointer with the same “AlternatePhysicsModel”?

just turn the lights on when you press the brake key and if the cars velocity is negative turn the reverse lights on. At least thats my understanding on how to do it. You could also try changing the lights material to a self-illuminated material. Theres tutorials all over the place about speedometers try searching google.

Yes I now there are tutorial about the speedometer but not for C# Script…

By the way, this is the script I use in the car: (Drivetrain)

From here where i put the brake lights and backward lights?

look for the script where Input is taken for the brake lights. As for the reversing lights make a new function and check if the gear is below zero and if it is turn the reverse lights on so it should look kinda like this (and remember to make a new variable thats a light container at the begining of the script to store your reverse lights) -

//This next line should go near the top of the script where variables are set up
public Light[] ReverseLights = new Light[2];

void Update()
{
    if (gear < 0)
    {
         //Turn the reversing lights on
         for (int i = 0; i < ReverseLights.Length; i++)
         {
              ReverseLights[i].enabled = true;
         }
    }
}

and just put an else case to turn them off. hope this helps

Tnks for help me, I’m trying the script…

By the way, do you know the “Car Tutorial” AlternatePhysicsModel?

I’m using it for my current game. I don’t know every thing about it. For me I’m learning as I use it and I’m modifying the code so I can enable and disable the car when I want. And your welcome :).