activeSceneChanged hates me

Hi forum,

I have that little something that’s driving me crazy. I’m trying to fire some methods on active scene changed, so I wrote some code that looks like that :

using UnityEngine.SceneManagement;

public class LeEventManager:MonoBehaviour{

void Awake()
{
SceneManager.activeSceneChanged+=someMethod;// subscribe
}

void OnDestroy()
{
SceneManager.activeSceneChanged-=someMethod;// unsubscribe
}

(...etc)
}

But everytime the compiler tells me: " UnityEngine.SceneManagement.SceneManager does not contain a definition for activeSceneChanged".

What am I missing? Please help me, I’m unfamiliar with events and the online official documentation of activeSceneChanged is especially unhelpful.

That functionality is brand-new in 5.4 I believe so I’ll get the obvious question out of the way- are you using the most recent version of Unity?

It’s absolutely valid to check that first indeed… I’m using Unity 5.3.6f1 which is still quite new but maybe I need to update Unity before asking further questions. Thanks ! :smile:

As a side note, Unity documentation is somewhat tricky: it displays by default v5.4 which is still in beta testing, and requires user action to switch back to 5.3 which is the current stable version… Not to say that it wasn’t my mistake however :slight_smile:

The current stable version is 5.4, which is why it displays that by default. As far as I know, there’s no beta version right now.

Had the same problem, turned out I had my own SceneManager, which was the one picked up and of course, didn’t have the activeSceneChanged definition

There are a few features under public alpha/beta at the moment, 2D features and the like.

Yup, but I made the comment in August and there weren’t any alpha or beta versions available at the time. In a semi-related note, I’m really looking forward to the new NavMesh and scene directing tools, but they keep pushing them back- I think they’re back in the “no idea” alpha list of future features instead of the beta list like they were a couple months ago.

Whoops. Burned by a necro again. Apologies for that…