I need help with this script I'm working on it manages the pcars steering angle through the script object so I can customize the cars steering but I can't figure out how to get this script to use both the left and right controls.
Code: [Select]
float Time = 0.04;
float NormalTurn = 1.0f/60f;
float TurnSpeed = Time;
float Turn = 1.0/60;
void Main()
{
if (iInitializing())
{
Turn = NormalTurn;
}
if (iKeyDown(iKeyCode("DIK_Left")))
{
Turn = iFloatTendTo(Turn,NormalTurn,1,TurnSpeed,0);
OUT_0 = iFloatTendTo(Turn,NormalTurn,1,TurnSpeed,0);
}
else
{
Turn = iFloatTendTo(Turn,1,NormalTurn,TurnSpeed,0);
OUT_0 = iFloatTendTo(Turn,1,NormalTurn,TurnSpeed,0);
}
if (iKeyDown(iKeyCode("DIK_Right")))
{
Turn = iFloatTendTo(Turn,NormalTurn,-1,TurnSpeed,0);
OUT_0 = iFloatTendTo(Turn,NormalTurn,-1,TurnSpeed,0);
}
else
{
Turn = iFloatTendTo(Turn,-1,NormalTurn,TurnSpeed,0);
OUT_0 = iFloatTendTo(Turn,-1,NormalTurn,TurnSpeed,0);
}
}