Jump to content

How to start the physics loop programatically


Recommended Posts

Is it possible to get the OnFixedUpdate() running programatically without activating the first stage?

The reason for my question is that I am writing an FTL mod:

http://forum.kerbalspaceprogram.com/threads/114401-0-90-FTL-Drive-%28Updates-on-development%29?p=1814164#post1814164

and while the right way to use it is to build a ship launch it into orbit and then jump from there, a quicker way to just try it out, is to catapult a ship into orbit directly from the launch pad with Hyper Edit.

The problem with that is that then the OnFixedUpdate() does not get called and the mod will not work (i.e. the ship will not jump). This leads to comments about the mod not working.

I would like to include a check in the action that starts the drive, whether the physics loop/OnFixedUpdate() get called and if not then start it. However, I have not been successful.

Any help would be really appreciated, and thanks in advance for your help.

Link to comment
Share on other sites

OnStart, OnUpdate, and OnFixedUpdate (in PartModule) run only when the part is active. Start, Update, and FixedUpdate run regardless. Use them.

That solved the problem.

Thank for you the solution.

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...