Elles m'aident énormément ^^
Mais j'ai un soucis avec le script "CarUserControl.cs" (vidéo pour conduire une voiture).
Le Code :
Code : Tout sélectionner
using UnityEngine;
[RequireComponent(typeof CarController)]
public class CarUserControl : MonoBehaviour{
private CarController car; // the car controller we want to use
void Awake ()
{
// get the car controller
car = GetComponent<CarController>();
}
void FixedUpdate()
{
if(Global.isInCar && Global.car == transform){
float h = CrossPlatformInput.GetAxis("Horizontal");
float v = CrossPlatformInput.GetAxis("Vertical");
car.Move(h,v);
}
}
void OnTriggerStay(Collider obj){
if(obj.tag == "Player" && !Global.isInCar){
Global.ShowText("Appuyez sur E prendre le véhicule");
if(Input.GetKeyDown(Global.actionKey)){
Global.car = transform;
Global.SwitchPlayer();
}
}
}
void OnTriggerExit(Collider obj){
if(obj.tag == "Player"){
Global.ShowText("");
}
}
} //end of class
Donc voilà le problème, dans la console il me dit que j'ai une erreur à la ligne 45 donc la toute dernière celle avec le commentaire ... mais je ne comprend pas.
Un idée SVP ?