Jump to content

Trying to figure out how to transport a ship with code


Recommended Posts

Hello, I'm trying to change the orbit of a ship to a high orbit around Eve using the following code.


double testHeight = FlightGlobals.Bodies[5].Radius + Convert.ToDouble(FlightGlobals.Bodies[5].maxAtmosphereAltitude) + 1000000;
Orbit testOrb = new Orbit(0, 0, testHeight, 0, 0, 0, 0, FlightGlobals.Bodies[5]);
FlightGlobals.ActiveVessel.orbitDriver.orbit = testOrb;

When I apply this as a module onto a stock part and then activate it via right-click menu while on the launchpad, it doesn't work, as shown in this screenshot with the debug menu:

Pcflfn5.png

Anyone can figure out what is wrong with my code?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...