- Home /
Why is my texture2D screenshot coming out as a grey box?
When I look up my problem online, people said the answer was to use Apply() after it, but so far that hasn't worked. Any ideas?
public Texture2D MapShot()
{
mapScreen = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
mapScreen.Apply();
//Took the shot
return mapScreen;
}
That's just creating an empty texture. Where are you taking the screenshot?
Answer by wojtask12 · Jul 14, 2016 at 08:04 PM
Take a look here https://docs.unity3d.com/ScriptReference/Application.CaptureScreenshot.html if you want to save the screenshot as a file. Check this out: https://docs.unity3d.com/ScriptReference/Texture2D.ReadPixels.html if you need the Texture2D
Your answer
Follow this Question
Related Questions
LeanTween.moveLocal sometimes snaps to position rather than moving over time 0 Answers
Retrieve screenshot image 0 Answers
LeanTween.moveLocal sometimes snaps to position rather than moving over time 0 Answers
UI fade with CanvasGroup vs of Image.color.alpha or Text.color.alpha performance 1 Answer
How to snap UI element anchor relative to image sprite? 2 Answers