Door scripting, changing scenes
Hi. Im new at making scripts and programming. How can i make a script that when the character is near the door and then click the door and appear a button saying enter and change the scene ? Sorry my bad language.
Answer by Landern · Nov 16, 2016 at 02:28 PM
Make door script.
Ensure door object has collider to check for mouse clicks
In door script have public variable for level name or index in build settings.
When door is clicked have UI button appear on a canvas
Have same door script have an attached event to button
When button is clicked have it invoke SceneManagement.LoadLevel(PublicVariableNameThatYouSetInInspectorFOrNextLevel)
Edit: My suggestion is to use the search box at the top of the site and search for "door script" it's an extermely common question and you may learn something which will be more useful for you.
When i just searched i got 112325 results, plenty of examples and problems/implementation others have had/used.
Answer by JTAGames · Mar 20, 2021 at 04:02 AM
We made a tutorial on how to change scenes and end up in the right spot on our channel.
https://www.youtube.com/watch?v=U18j9t0XkaA
Hope this helps!
Your answer
Follow this Question
Related Questions
Cant make Door Open 1 Answer
How would i modify my current script to remove these UI buttons without killing my pause menu? 1 Answer
How to make a button control Animator animation 0 Answers
Adding listeners buttons in for loop 0 Answers
How do I run a method/behaviour upon GUI button press(onClick)? 0 Answers