Snapshot Tutorial: Making Image Files From Unity Cameras

  Рет қаралды 55,117

Board To Bits Games

Board To Bits Games

Күн бұрын

Пікірлер: 78
@robelso5646
@robelso5646 2 жыл бұрын
This is mind blowing. Thank you so much for the amazing tutorial!! I’ve been looking forever for something like this, and this is exactly what I needed!
@rodolfoleal7295
@rodolfoleal7295 5 жыл бұрын
Thank you! I'll be using this feature on my project.
@mdmarufhowlader7036
@mdmarufhowlader7036 3 жыл бұрын
It does not capture Canvas element say Text, Button, Image
@msahkoo
@msahkoo 4 жыл бұрын
Can you help in that!! How can access phone camera and take pictures , then use this picture as texture or we can say use in build?
@mayonez6248
@mayonez6248 4 жыл бұрын
This is really informative, and easy to understand! Thanks!
@manochnumfu8340
@manochnumfu8340 4 жыл бұрын
Hello, Your tutorial is very good for me but I have one problem, I can't drag the Snapshot Camera put in the Snap Cam, at show in the last step. I don't know why, could you help me about this problem. Thank a lot.
@mayonez6248
@mayonez6248 4 жыл бұрын
If you can't drag, you could instead click on the circle to the left of where it says Snap Cam. A menu should open up on the top left of your screen, where you can find and select the snapshot camera from there
@VirtualTurtleGames
@VirtualTurtleGames 3 жыл бұрын
Hi, using the Linear color space, this seems to produce very dark and weird-colored images. I've seen other people complaining about this too, but no solutions yet. Does anyone know how to get an image with correct colors using this method and the linear color space? Thanks!
@DucatChannel
@DucatChannel 2 жыл бұрын
The solution is to create the Render Texture on the fly - that way it woul create a texture with correct color format. You just need to not put your manualy created RenderTexture to the script.
@VirtualTurtleGames
@VirtualTurtleGames 2 жыл бұрын
@@DucatChannel That's a good answer, thanks. Even tho that project of mine is not being worked on anymore, it might help someone else!
@arturs232
@arturs232 5 жыл бұрын
Thank you! But how do I save pictures over 4k big? 4096X4096 are working fine, but I need higher resolution (8192x8192 and 16384x16384) - Assertion failed on expression: 'm_Memory.renderTextureBytes >= 0' UnityEngine.Camera:Render() HiResScreenShots:LateUpdate() (at Assets/HiResScreenShots.cs:32) Can you help please?
@Erhanjinn
@Erhanjinn 5 жыл бұрын
Thanks for the tutorial! It helped me in my own project.
@BoardToBitsGames
@BoardToBitsGames 5 жыл бұрын
Glad it helped! Thanks for watching!
@timurs.923
@timurs.923 5 жыл бұрын
It almost works. For some reason, the things that are in the LateUpdate() function aren't being called. Thanks
@DougyFreshGames
@DougyFreshGames 5 жыл бұрын
Same boat. The functions in lateupdate aren't being called and the debug log isn't either.
@chandrikasaidasari3672
@chandrikasaidasari3672 Жыл бұрын
I a not able to add Snapshot Camera object to a Player Script which will display in the Inspector when we click on Player object? Can please tell why I am unable to add Snapshot Camera to player Script.
@JoJ1994
@JoJ1994 5 жыл бұрын
The code works perfectly when I test it in Editor. But the image captured in mobile is horrible. It is full of noise and repeating a small piece of the camera screen. I have changed to file path from dataPath into persistentDataPath but it still doesn't work well.
@charlieratcliffe7294
@charlieratcliffe7294 2 жыл бұрын
Hey, great video! Almost exactly what I need. Question, is there a way to then store the pictures taken within the game itself? Such as how you can take photographs in multiple Zelda titles, as well as Pokemon Snap? Any help would be great, thanks!
@SassyPantsy
@SassyPantsy 2 жыл бұрын
I hope I'm still relevant, but anyway - what you want to do, is gain access (through your game) to the path (the folder) in which the taken pictures are saved. For instance, if they're saved in - C:/Pictures/MyGamePictures, then you want to build some sorts of class that can ExtractPictures() from said path. Then, you need to display them somewhere in your game (probably a sorting menu or something like that). Anyway, I'd recommend marking/tagging these pictures with something, so that you won't get random pictures showing in your game (unless you want to, ofc). Hope I've helped
@charlesdeschamps2844
@charlesdeschamps2844 5 жыл бұрын
Great video, you maked my day
@snakeplisken4278
@snakeplisken4278 4 жыл бұрын
How do you do this with an actual in-game camera object. ie instead of letting the player hold an axe, have the fpscontroller hold a camera object that he can aim with right clicke, then zoom then take snapshot.
@alishamandholia3770
@alishamandholia3770 4 жыл бұрын
Hi, did you find a solution? I'm looking for something similar
@walterwhite42068
@walterwhite42068 4 жыл бұрын
Make an fbx model of cam and make two animations. One when zooming in (goes to eyes) and one when zooming out. On rightmousebuttonup zoom out and on rightmousebuttondown zoom in by changing camera field of view. Lastly disable and enable camera meshrenderer in zoom in and out anims and after that enable snapshot script so u can click and snapshot will be taken
@mepaul7016
@mepaul7016 2 жыл бұрын
Thanks !, so useful and already implemented with some modifications.
@themadmadsen
@themadmadsen 6 жыл бұрын
You are bloody beautiful! Tutorial was fantastic and this was exacty what I was looking for! Cheers!
@lottekapunkt9725
@lottekapunkt9725 Жыл бұрын
Thanks! Worked like a charm.
@SHAIJUJANARDHANAN
@SHAIJUJANARDHANAN 3 жыл бұрын
Great video. Works like a charm :)
@praveenb-xr
@praveenb-xr 2 жыл бұрын
Hi what should I do to take a scrrenshot of specific region and apply it as texture to object in AR ?
@walterford5742
@walterford5742 3 жыл бұрын
How would I take the screenshots and have them displayed? I have an Idea but I'm not sure
@Devlinflaherty
@Devlinflaherty 4 жыл бұрын
The tutorial was very helpful, but what do I do if I want to be able to access these screenshots in a complete build? From what I've seen I can only access them in the editor.
@walterwhite42068
@walterwhite42068 4 жыл бұрын
Use Application.persistentDataPath instead of Application.dataPath in the script and to view snapshots after taking those in builds, on windows go to Appdata, then LocalLow, your Company name, your gamename and in the snapshots folder (you have to create snapshots folder via script as it doesn't pre-exist).
@Devlinflaherty
@Devlinflaherty 4 жыл бұрын
@@walterwhite42068 Thanks. :)
@walterwhite42068
@walterwhite42068 4 жыл бұрын
@@Devlinflaherty Welcome :D
@carlisr1111
@carlisr1111 3 жыл бұрын
@@walterwhite42068 what can i do in mac?
@tomxuan9050
@tomxuan9050 4 жыл бұрын
Thank you very much for this video! I have been successfully implementing this method. However, just a quick question: is there any way to prevent the ".meta" file from being saved together with the image file?
@DocKaotic
@DocKaotic 3 жыл бұрын
The .meta file is only saved when storing photos that are accessible by the editor. (i.e. if you built the game and installed it somewhere else, it wouldn't have those)
@nahuelchaza
@nahuelchaza 4 жыл бұрын
Hi, great tutorial. I have one question How could I add a shadder with a fx to the camera, but when I Take the snap the effect didnt show it. I cant figured where is the problem, With this method should I apply the texture to the render texture maybe? thanx
@davidpratt8022
@davidpratt8022 6 жыл бұрын
is it possible to use a screenshot and apply it to a material for example as the game is running
@samroberts5480
@samroberts5480 5 жыл бұрын
Did you ever get an answer on how to do this? Very curious how to do?
@walterwhite42068
@walterwhite42068 4 жыл бұрын
Yes you can. Set the material texture to the png file you want to use in script in a try catch block since the png file might not be there.
@Neoseanner
@Neoseanner 3 жыл бұрын
I have 0 idea about programming , is the script from the link exactly the same as the one in the video? i think my script can't be inserted because something called monoBehaviour , which it's already in the script i don't know why help me :(
@catsandgames9871
@catsandgames9871 3 жыл бұрын
You should try something much easier in Unity than this.
@DrINTJ
@DrINTJ 5 жыл бұрын
Great to learn that Unity needs such a lot of work to do simple stuff.
@catinmask
@catinmask 5 жыл бұрын
Just a single line of code: ScreenCapture.CaptureScreenshot();
@TheRealZeaga
@TheRealZeaga 5 жыл бұрын
Unless you need to capture a render from a separate camera or at a different resolution, it's already a single function.
@inhtruonggiang1463
@inhtruonggiang1463 5 жыл бұрын
sir, how can i extract every frames form my game, (about 20 Frames per second). In my update() function, i just put the function snapcam.callsapshot(), but it is likely that i just received 1 frame per second,
@batosalangit1438
@batosalangit1438 Жыл бұрын
can this be done in a WebGL app?
@heromoga2000
@heromoga2000 5 жыл бұрын
Is This can be applied to hololens ?
@Максимтепанов
@Максимтепанов 4 жыл бұрын
тот же вопрос
@TheTechpreneurs
@TheTechpreneurs 4 жыл бұрын
Thank you very much
@foolishonboards
@foolishonboards Жыл бұрын
Would it be possible to assign a really huge size to the texture like 8k by 8k or more ?
@anactualalpaca7016
@anactualalpaca7016 Жыл бұрын
Yes, yes it is
@foolishonboards
@foolishonboards Жыл бұрын
@@anactualalpaca7016 you tried it?
@nv7287
@nv7287 3 жыл бұрын
Oh yay this is so cool thanks a million!
@reinielvillones1801
@reinielvillones1801 5 жыл бұрын
it is work for the gallery store after take the screen shot?
@reniyato9002
@reniyato9002 3 жыл бұрын
why didnt you use the onEnable() method? its way easier than manually checking if the camera is enabled
@eladonstar2721
@eladonstar2721 3 жыл бұрын
omg brother I love u so much..u saved my day.Thx a lot it's Working
@MijanurRahman-jo1st
@MijanurRahman-jo1st 5 жыл бұрын
How can I apply same process in mobile? please help.
@NheroxD
@NheroxD 5 жыл бұрын
How can I apply same process in mobile?
@fb1740
@fb1740 5 жыл бұрын
Thanks a lot !
@DasFrettchenFreddy
@DasFrettchenFreddy 5 жыл бұрын
When I try to add the Snapshot Camera script to the camera as you explain at 8:35 I get an error message saying "Can't add script behavior TMP_CoroutineTween. The script needs to derive from MonoBehavior!" I would appreciate it sooo much if you could help me figure out whats wrong. Thank you so much!
@BoardToBitsGames
@BoardToBitsGames 5 жыл бұрын
It sounds like in the class declaration, after “public class SnapshotCamera” you need to add “: MonoBehaviour”
@DasFrettchenFreddy
@DasFrettchenFreddy 5 жыл бұрын
@@BoardToBitsGames thanks for your reply! it already has the : MonoBehavior in the code, so no clue what's wrong: using System.Collections; using System.Collections.Generic; using UnityEngine; public class SnapshotCamera : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
@Sparrow420
@Sparrow420 5 жыл бұрын
You dragged the wrong thing in there man, it says your script is called "TMP_CoroutineTween", clearly this is from the Text Mesh Pro library.
@mikewigen8646
@mikewigen8646 3 жыл бұрын
Damnit!!! This is like the 10th tutorial I follow with the same damn result. My screenshots are saved alright but they are always solid black. nothing is shown. What am I doing wrong? Should I change anything to the camera so it can see stuff? Is this a limitation for the free version of unity? is there something with my setup. I have a canvas with screen overlay and Im trying to take a snapshot of a specific gameobject on the scene containing UI things. Im working in 2d. I don't have any 3d things. anyone got a clue?
@developmentstudio9917
@developmentstudio9917 4 жыл бұрын
For android this work?
@andersonleao3413
@andersonleao3413 4 жыл бұрын
Muito obrigado!
@lee1davis1
@lee1davis1 6 жыл бұрын
I know this is off topic. But concerning audio listeners. What if you are creating a split screen space game and your two players are not in the same sector. How do sounds get played for player two if his camera doesn't have an audio listeners? Thanks
@BoardToBitsGames
@BoardToBitsGames 6 жыл бұрын
lee1davis1 good question. Without having done much research on it, you might have to rig up some sort of dummy listening system with one listener that gets passed the audio for both players. Like if player 2 walks by a waterfall, you instantiate a duplicate audio source in the same relative position by player 1 (who would have the listener) or pass both 1 and 2’s local audio sources to a separate communal listener
@JM-dc5rn
@JM-dc5rn 25 күн бұрын
A lot of comments in here from people who don't know the basics of coding...just go learn the basics. You're wasting your time just trying to copy and paste someone else's code and not having a clue what the lines do. Some of you show you don't even know the unity basics..
@robmitchell3928
@robmitchell3928 4 жыл бұрын
cool, although I clicked here to learn how to save an image, not create a level. From now on just start with the subject at hand.
@catinmask
@catinmask 5 жыл бұрын
Pardon? 30 min tutorial just for a simple screenshot? What is ScreenCapture.CaptureScreenshot() for then? :D
@BoardToBitsGames
@BoardToBitsGames 5 жыл бұрын
If you want to capture a different camera than the main one or get the raw camera input without the rest of the effects on the screen (eg UI) this can be helpful.
@saadanees7989
@saadanees7989 5 жыл бұрын
this is literally a 5 min video or less.. too much speaking.
@saadanees7989
@saadanees7989 5 жыл бұрын
Just show dragging script and taking snapshot from key or button...
@TheRealZeaga
@TheRealZeaga 5 жыл бұрын
@@saadanees7989 I mean, yeah. If you want to learn absolutely nothing and never grow as a developer, you can just drag someone else's script in and just be able to have it work. This is useful for people who want to learn how to do this themselves.
@rajatbhalla1455
@rajatbhalla1455 4 жыл бұрын
Will it work for AR camera ??
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
Unity Camera Controls, Part 1: Core Functionality
43:33
Board To Bits Games
Рет қаралды 22 М.
So Cute 🥰
00:17
dednahype
Рет қаралды 55 МЛН
Making UI That Looks Good In Unity
18:06
Game Dev Guide
Рет қаралды 676 М.
Take PHOTOS in Unity (POLAROID Pictures Camera UI)
22:23
SpeedTutor
Рет қаралды 17 М.
Making an atomic trampoline
58:01
NileRed
Рет қаралды 7 МЛН
Coding Adventure: Rendering Text
1:10:54
Sebastian Lague
Рет қаралды 698 М.
The Beauty of Bézier Curves
24:26
Freya Holmér
Рет қаралды 2 МЛН
Somebody emailed me a trojan virus
14:06
Bog
Рет қаралды 737 М.
Unreal Engine Materials in 6 Levels of Complexity
44:12
pwnisher
Рет қаралды 241 М.
LIGHTING in Unity
16:13
Brackeys
Рет қаралды 1,2 МЛН
Intro to Tool Dev in Unity - An Improvised Live Course [part 1/4]
3:39:31
Device Camera - How to - Unity 3D [Tutorial]
14:11
N3K EN
Рет қаралды 189 М.
So Cute 🥰
00:17
dednahype
Рет қаралды 55 МЛН