- Home /
How can I - Display camera view from scene in another scene?
Hello.
I'm trying to create fancy cards with 3D "pictures" on them. If someone played MTG or any trade card game, probably understand my problem and idea better. Sample of a card. As You can assume, there would be many cards, with different pictures.
Because I am not a graphic, I can't make decent 2D sprites, and thought that creating a scene from models, and rendering it on a card would be easier, and prettier, because of all the animations, effects and stuff which can be created in Unity.
I found how to render view from a camera on a object (TextureRender), that's fine. But I'd like to create scene for each picture of card, and display view from camera in that scene on a card. I can workaround it making many cameras, and all my "scenes" somewhere in the world, but it seems to be clumsy. The main thing is, that I would like to use all the features of normal scene, translation, rotation, moving camera for different point of view on a card, special effects and such... [EDIT] when game is running (that's important), so when player pick a card, and look at "picture" he would see moving objects (for example two monsters fighting each other, and casting spells, what will be scripted in scene).
Unfortunately I don't know how:
Store a scene inside memory. (On a list, and get elements from stored scenes.)
Use variables between these scenes. (Like camera, which would make TextureRender for me.)
I'm using C# for scripting, and Unity 5 Personal Edition (it allows to use TextureRenders).
Maybe You have another ideas for duplicating desired by me effect?
Thank You in advance, Drakonno
You can use layers, put your object on a different layer, have a camera that renders only that layer, and render it to your texture. Have you main camera render NOT that layer, but everything else. Done!
Point for idea of layers. Strange that I forgot them. Probably because I don't like "random things" packed into one box.
I'd still prefer having possibility to create Co-Scenes somehow. Just less mess inside all prefabs and objects. :)
Answer by Scribe · Sep 09, 2015 at 11:32 AM
You could create the scenes separately, you could then load them additively. But everything you end up using has to eventually be available in your current scene. Which other scenes aren't unless you load them up.
EDIT: With card games you also have the benefit that the camera doesn't move far. Hence you could build your scenes with the camera and model and just position them somewhere high up or far away from the origin, then load them additively. Then you don't have to worry about setting layer masks and things!
That's it. Layers and LoadSceneAdditive do the job. Could You reply (or convert into answer) ins$$anonymous$$d of commenting that I can accept it as answer?
Answer by IHackedDeath · Sep 09, 2015 at 09:56 AM
Hi Drakonno,
I have read through your question and I am not too sure on how to get the desired effect you are after in unity, but seeing as it sounds like you have created 3d Objects for them I would assume that you use a 3rd party program (eg. 3dMaya, Blender etc.)
What I would do is in those programs I would take a screenshot and save it as an image and then bring that into unity or modify it in another program like photoshop then bring it into unity.
This way you can create a card without needing a camera.
If you were after some more information or wanted further explenation I am happy to help :)
I hope this helps.
Kind Regards.
IHackedDeath.
Hello,
Thank You for answer, I realised that I missed important thing in my question. Edited.
The thing is I want to create a something better than 2D and static picture, so screenshot won't solve it. If a player pick a card, and look in place, where should be a picture, he should see a moving objects. That's why I was messing around with TextureRenders.