How do I make an object Instantiate in other scene by clicking a button?

I need an object to be instantiated in other scene.

  1. How do I make the script work when the button is clicked.
  2. How do I get access to an another scene? I need to get location using Vector3 in that scene.

As far as i know: you don’t - scenes are not editable during runtime in a built game. The easiest way to achive this is to buffer everything that should be done in the next scene and do it once the next scene is loaded. Simply create a script to execute the instantiation when the scene is loaded.

Things that might come in handy to solve this: DontDestroyOnLoad to carry an object over to another scene. The SceneManagement OnSceneLoaded callbacks so that you know that the new scene is loaded that you can execute your stuff.

If you need more precise help we’ll need more info. You describe that you need something complex done that you describe in 4 short questions/sentences without any context or what you have or have not achived yet. Provide more information and relevant existing code please.