diff --git a/Assets/AWSIM/Scripts/Vehicles/VehicleOverrideInputManager.cs b/Assets/AWSIM/Scripts/Vehicles/VehicleOverrideInputManager.cs index 4fd2bb70a..d444f5eb3 100644 --- a/Assets/AWSIM/Scripts/Vehicles/VehicleOverrideInputManager.cs +++ b/Assets/AWSIM/Scripts/Vehicles/VehicleOverrideInputManager.cs @@ -29,17 +29,20 @@ public class VehicleOverrideInputManager : MonoBehaviour [SerializeField] Vehicle vehicle; - void Update() + private void FixedUpdate() + { + ApplyInput(); + } + + void ApplyInput() { VehicleInputBase.InputArg inputArg = new VehicleInputBase.InputArg(ControlMode, AutonomousInput.SteeringInput); // Update new input for Autonomous and Manually Inputs. AutonomousInput.OnUpdate(inputArg); ManuallyInput.OnUpdate(inputArg); - } - private void FixedUpdate() - { + // If override input is present, switch new ControlMode. if (ManuallyInput.Overridden) { @@ -61,8 +64,6 @@ private void FixedUpdate() vehicle.AutomaticShiftInput = ManuallyInput.ShiftInput; vehicle.SignalInput = ManuallyInput.TurnSignalInput; } - - // TODO: Implement inputs to the vehicle in the case of other control modes. } } } \ No newline at end of file