I would have this problem with my script, so i’m not sure where to put my joystick inputs.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
public RCC_CarControllerV3 carController;
public float myGasInput = 0f;
public float mySteerInput = 0f;
public float myBrakeInput = 0f;
public float myHandbrakeInput = 0f;
void Update() {
if (!carController)
return;
carController.gasInput = myGasInput;
carController.steerInput = mySteerInput;
carController.brakeInput = myBrakeInput;
carController.handbrakeInput = myHandbrakeInput;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
public RCC_CarControllerV3 carController;
public float myGasInput = 0f;
public float mySteerInput = 0f;
public float myBrakeInput = 0f;
public float myHandbrakeInput = 0f;
void Update() {
if (!carController)
return;
myGasInput = Mathf.Clamp(Input.GetAxis("Vertical"),0f,1f);
myBrakeInput= Input.GetAxis("Break");
carController.gasInput = myGasInput;
carController.steerInput = mySteerInput;
carController.brakeInput = myBrakeInput;
carController.handbrakeInput = myHandbrakeInput;
}
}