While trying to figure out the add on I've discovered something to help. In the CarUserControl.cs
Replace your CarUserControl.cs and solve issues
using System;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
namespace UnityStandardAssets.Vehicles.Car
{
[RequireComponent(typeof(CarController))]
public class CarUserControl : MonoBehaviour
{
private CarController m_Car; // the car controller we want to use
private V_CarControl vCarCtrl;
void Awake()
{
vCarCtrl = this.gameObject.GetComponent<V_CarControl>();
// get the car controller
m_Car = GetComponent<CarController>();
}
void FixedUpdate()
{
if (vCarCtrl.PlayerDriving)
{
// pass the input to the car!
float h = CrossPlatformInputManager.GetAxis("LeftAnalogHorizontal");
float v = CrossPlatformInputManager.GetAxis("RT");
#if !MOBILE_INPUT
float handbrake = CrossPlatformInputManager.GetAxis("Jump");
m_Car.Move(h, v, v, handbrake);
#else
m_Car.Move(h, v, v, 0f);
#endif
}
}
}
}
I'm using Unity 2019.2.0f1, Invector 2.5a, Standard assets are in the Invector-3rdPersonController folder, VehicleAddon is moved outside of SJL VEHICLES AND STUFF,
Redhawks code is also added In the V_CarController I replaced the current line 654 with the below:
if (GetComponent<CarController>() != null) { GUISystem.CurrentCarSpeed = GetComponent<CarController>().CurrentSpeed;
Also touchstonebros code is used Wanted to give credit to all who helped
Add this to CarUserControl.cs
private V_CarControl vCarCtrl;
private void Start()
{
vCarCtrl = this.gameObject.GetComponent<V_CarControl>();
}
private void FixedUpdate()
{
if(vCarCtrl.PlayerDriving)
{
//...
}
}