Hello.

I want to call the Scene transition function of Scene Changer at the end of another script.
Currently, I am thinking of getting a Scene Changer with GetComponent at the end of another script and performing Scene transition processing.
If you want to do this, please tell me how to call the Scene Changer function.

Sincerely
  • Hi @touhu I might be wrong, but first it depends on how the Start Type is setup in your SceneChanger Component, then you can call the StartEvent(GameObject startingObject) method and pass null for the GameObject parameter if you have none
  • StartEvent doesn't depend on the start type, it's the method that's called by the various start type methods :)

    So, this'll start your scene change:
    changer.StartEvent(null);
    changer is the SceneChanger component.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for your reply.
    Is the SceneChanger component an instance of the SceneConnectionSceneChanger class?
    Please give me some advice on how to set up an instance to call Start Event.
    Sincerely
  • I'm sorry, the above has been resolved.
    I implemented changer in the following form.

    changer = new ORKFramework.Behaviours.SceneChanger ();

    I'm thinking of a way to pass the scene name, Spawn ID, etc. of the destination to this changer.
    If the argument is null, the destination scene cannot be specified, so please tell me what to do.

    Sincerely
  • You can't really create components like that, you need to do it like this:
    SceneChanger changer = new GameObject().AddComponent<SceneChanger>();

    To change the scene name, spawn ID, etc. you can do that on the scene changer's target, e.g.:
    changer.target[0].sceneName = "New Scene";

    A scene changer can have multiple targets (one is selected randomly), the first one is added automatically on a new scene changer.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for your response.
    I was able to change the screen using the method you taught me.
    Thank you for your reply many times.

    Sincerely
Sign In or Register to comment.