public void StartDriving(bool isReentering = false) { if (trainHandler != null && trainHandler.Exists && isReentering) { trainHandler.SpeedMPH = 88; _isReentryOn = true; return; } trainHandler = TrainManager.CreateInvisibleTrain(Vehicle, _direction); if (!(trainHandler.Train.Heading >= Vehicle.Heading - 45 && trainHandler.Train.Heading <= Vehicle.Heading + 45)) { _direction = !_direction; trainHandler.DeleteTrain(); trainHandler = TrainManager.CreateInvisibleTrain(Vehicle, _direction); } trainHandler.IsAccelerationOn = true; trainHandler.IsAutomaticBrakeOn = true; trainHandler.SetCollision(false); trainHandler.SetToAttach(Vehicle, new Vector3(0, 4.28f, 0), 1, 0); //new Vector3(0, 4.48f, 0) //trainHandler.CruiseSpeedMPH = 1; trainHandler.SetPosition(Vehicle.Position); trainHandler.OnVehicleAttached += TrainHandler_OnVehicleAttached; trainHandler.OnTrainDeleted += TrainHandler_OnTrainDeleted; _isReentryOn = isReentering; }