- Home /
Load another scene into a popup window
I'm working on a creature simulation in Unity and I'm looking for a way how to load and display a scene in smaller popup window which will be displayed on hover event. Basically it should work something like this project.
I need to show all created creatures and when I hover over the creature I need to show how it behaves in real world so it should behave like a preview window.
Answer by Anis1808 · Dec 02, 2019 at 11:16 PM
Loading another scene as a popup is not a very easy process as you need to deal with camera and loading and unload every time a user hovers a creature. The best thing that would work would be to create a new camera (along with some environment and all) and create a script that displays the camera's view in a small window (which is way easier than a whole scene) and that also changes the creature with its animation as you hover). If you need any help writing this code it would be a pleasure.
Thank you for your response Anis1808! It sounds nice, can you tell what API should I use to achieve the cemaera's view in a small window? What I can do now is just use Scene$$anonymous$$anager.LoadScene("OtherSceneName", LoadScene$$anonymous$$ode.Additive);
but it displays a scene over the current one.
Update: I set up a small window in a scene with a creature. First option is to set the viewport rect of the camera and second option is to use a render texture, which is really great. Question is, how to use the render texture in another scene?
I don't know exactly how your project is setup so it depends but you could access the camera of the second scene by script and set its texture on your object a bit like in this link
That will work! Thank you, you saved my day!
Your answer
Follow this Question
Related Questions
How to play scene?,How to play my scene? 1 Answer
Generating a preview for a scene. 0 Answers
Classic Resident Evil-style room loading/level streaming? 4 Answers
What are the reason a scene don't reload the second time ? 0 Answers
Help with error message "Overwriting the same path as another open scene is not allowed" 0 Answers