Jump to content

[Help] NullReference when changing scene


Olympic1

Recommended Posts

I'm just a beginner in the coding but Ikeep getting a NullReference when change from a scene (ex: From Main Menu to Space Center)

This is my code where it throws the error

void Start()
{
foreach (var vessel in FlightGlobals.Vessels)
{
vessel.FindPartModulesImplementing<SkyLabExperiment>().ForEach(part =>
{
part.config = this;
});
}
}

I know that I need to 'destroy' this, but I just don't know how.

You can look into the code on my GitHub repo.

Edited by Olympic1
Link to comment
Share on other sites

In what context are you running this code? I'd have thought that most coding questions would probably be more on topic in e.g. the Add-On Development forum, rather than Gameplay Questions and Tutorials.

oops, wrong forum. I'll ask it there

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