Jump to content

DrakesForehead

New Members
  • Posts

    3
  • Joined

  • Last visited

Reputation

1 Neutral
  1. How do I get the vessels current pitch and heading, it should correspond to what is on the navball (straight up is 90) and the heading readout.
  2. public static OnStart() was meant to be public static Start() All working now
  3. I've looked around at different methods for getting and settings flight controls, but none of them have worked, except for the throttle which worked with the following code. FlightInputHandler.state.mainThrottle = 1.0f; I'm starting to wonder if it's due to any other addons as the throttle works (only using the code above). The code below is what I've currently got, but it doesn't work. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace TestAdd { [KSPAddon(KSPAddon.Startup.Flight, false)] public class TestAdd : MonoBehaviour { public void OnStart() { FlightGlobals.ActiveVessel.OnFlyByWire += MyControlSystem; } public void MyControlSystem(FlightCtrlState state) { state.roll = 1f; state.pitch = -1f; state.mainThrottle= 1f; } public void OnDestroy() { FlightGlobals.ActiveVessel.OnFlyByWire -= MyControlSystem; } public void Update() //This is another method i've tried { FlightInputHandler.state.roll = 1.0f; FlightInputHandler.state.pitch= -1.0f; } } }
×
×
  • Create New...