Forum rules - please read before posting.

void Start() is not called

Hi there.

I use the AC very much, however there are a few things that I would like to script on my own and I found a strange thing.
I have a GameObject with a script which has a void Start() function. I load the scene and my Start() is called, however if I load the game and I don't change the scene I don't see my Start() fired up.
What can I do?

Comments

  • Start() is a Unity function - and is only called automatically when a GameObject is turned on.  If you don't switch scene or destroy/reload the object, it's not going to be called regardless of whether you're using AC or not.

    To call a custom function when AC loads a scene, you have two options:
    1. Define an OnLoad custcene in your Scene Manager, and give it an Object: Call event Action to trigger the function (make sure your Start method is public).
    2. Hook into the OnFinishLoading custom event directly within your script.  For more on custom events, see the Manual chapter of the same name.
  • Thank you. The first option worked for me
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.