Code not working when scene switched

When I switch scenes using an action none of the code or behaviors activate, but when I start on the second scene it works just fine. Anyone know why?

As mentioned in your other thread, linked/external events have nothing to do with scene changes.

You would need to show your events from both scenes for people to assist. (Screenshots only please, no camera photos.)

Here is a video showing all the code and what is going wrong with the scene switching

That’s an easy answer. You have “Change scene” in your “at the beginning of scene” events, in your external event sheet.

It’s constantly starting that new scene, which means it’s constantly at the start of a scene, so it’s looping.

1 Like

I’m surprised it even works. In the very first event of NewExternalEvents, why are you changing scene without a condition? It’ll change scene. Every. Single. Frame.

Do the change scene when the global variable SceneNumber is changed (upoon return key being pressed).

Beaten by a minute :smiley:

1 Like

Oh ok thanks, I’m dumb lol, don’t know how I didn’t see that

One last question, should I even be using this method? Does it improve performance?

External events improve your development efficiency since you don’t have to recreate events every time. So even if it doesn’t make your game faster, it’s useful.

Since you’re using the same events in external events or in the scene event sheet, there will be no difference in performance in the compiled game. There may be difference in performance while you’re editing in the scene editor, though, if you have a ginormous amount of events.

Ok, thanks again for all the help