I don't remember what I did but it was probably important
This commit is contained in:
@@ -17,6 +17,7 @@ public class InstrumentManager : MonoBehaviour
|
||||
[Header("References")]
|
||||
public MainEngine mainEngine; // Reference to your engine script
|
||||
public GimbalSystem gimbalSystem; // Reference to gimbal control system
|
||||
public RCSController rcsController; // Reference to RCS control system
|
||||
// Referance to TextMeshPro Throttle slider
|
||||
public Slider throttleDisplay; // Reference to UI Slider component
|
||||
|
||||
@@ -80,7 +81,7 @@ public class InstrumentManager : MonoBehaviour
|
||||
}
|
||||
|
||||
// Handle attitude control input
|
||||
if (attitudeAction != null && gimbalSystem != null)
|
||||
if (attitudeAction != null)
|
||||
{
|
||||
// Read Vector3 input
|
||||
Vector3 attitudeInput = attitudeAction.action.ReadValue<Vector3>();
|
||||
@@ -92,9 +93,20 @@ public class InstrumentManager : MonoBehaviour
|
||||
// Y (up/down) → Pitch
|
||||
// X (left/right) → Yaw
|
||||
// Z (forward/backward) → Roll
|
||||
gimbalSystem.SetPitchInput(attitudeInput.y);
|
||||
gimbalSystem.SetYawInput(attitudeInput.x);
|
||||
gimbalSystem.SetRollInput(attitudeInput.z);
|
||||
if (gimbalSystem != null)
|
||||
{
|
||||
gimbalSystem.SetPitchInput(attitudeInput.y);
|
||||
gimbalSystem.SetYawInput(attitudeInput.x);
|
||||
gimbalSystem.SetRollInput(attitudeInput.z);
|
||||
}
|
||||
|
||||
// Map inputs to RCS controller:
|
||||
// Vector3(x=yaw, y=pitch, z=roll)
|
||||
if (rcsController != null)
|
||||
{
|
||||
Vector3 rcsInput = new Vector3(attitudeInput.x, attitudeInput.y, attitudeInput.z);
|
||||
rcsController.SetControlInput(rcsInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user