[Solved] Problem with SceneManager.LoadScene and RuntimeInitializeOnLoadMethod

Hello,

I’ve been working on a Load / Save functionality for my game and I’m using SceneManager.LoadScene to reload the scene whenever I want to load a previous save. So far so good. The problem I’m encountering is that whenever the scene is reloaded the methods marked with [RuntimeInitializeOnLoadMethod()] are not called again. Is this intended behaviour? I tried looking at the documentation but couldn’t find any information regarding this.

Thanks in advance.

About the only thing I could find was a developer comment in a feedback entry that mentioned it was intended to be called after the first scene load which to me implies it is intended behavior.

https://feedback.unity3d.com/suggestions/runtimeinitializeonloadmethod-called-too-late

Welp I didn’t find that comment but it seems like you’re right.

I’ll have to change my code around but at least I know what changes I have to make :slight_smile:

Thanks!