- Home /
The question is answered, right answer was accepted
I need help to save my grid and show it in a different scene
Hello, Im making a small drawing game for kids, and I've made everything, now im trying to make it so the kid can save the image they created with the grids, and then be able to view it in a scene called Gallery. It will not be saving the picture to the mobile. Only to the game. If someone can just help me with the logic of it, i've much appericiate it. Thank you
Answer by SmomoGame · Nov 29, 2016 at 03:58 PM
Hi Aydin, You can use "Render Target" in the first scene. Place a camera to capture the drawing thing.
If you switch to new scene, the render texture will maintain the last frame before the scene change.
Then in your gallery, just make some Raw images with this Render Texture or objects with material that contain Render Texture.
The former is for 2D UI, latter is for 3D scene
If you don't know how to setup a render texture, I will explain farther.
@SmomoGame Can you explain further? Also is the documention good for render texture in unity documents?
$$anonymous$$anual looks very old... they do not update for the newer version
Anyway, the steps to achieve that :
Create a asset "Render Texture", it will add a texture-like asset.
Setting this render texture in the Inspector
Place a NEW camera to face the canvas, you can't use main camera because if the camera is used for render texture, it can't be a "Display camera".
Assign the render texture you just created to Target Texture slot in Camera component.
Return to the Asset panel, you will see that the render texture show the camera's view
Then you can use this texture freely. The render texture works in runtime, you just need to ensure that the camera never lost focus on the canvas until the scene change.
When the scene change, the camera stop to "Draw" on the texture, so the texture will maintain the last view
Answer by Chrisasan · Nov 29, 2016 at 06:27 PM
I suggest saving the grid mesh into a .obj file format. You can use the wavefront obj ancsii file format. The format is well documented, and you can create a small example for yourself using blender. You should be able to view it inside a text editor.
Follow this Question
Related Questions
How to find sprite at grid location? 1 Answer
Grid-based building system not working 1 Answer
grid-based block placement system with touch input 1 Answer
Create a grid on a cube? 0 Answers
moving down blocks 0 Answers