- Home /
How to use maked screenshot like a texture?
Hi, I doing screenshots like that:
void Update () {
if (Input.GetKeyDown (KeyCode.X)) {
a += 1;
nazwa = "Screenshot";
nazwa = nazwa + a.ToString ();
Application.CaptureScreenshot("Assets/Screenshots/"+nazwa+".png");
Debug.Log ("foto");
}
}
and how can i use maked screenshot to texture the object. Unity doesnt refresing assets in game and texturing doesnt work to. Thanks for help.
I don't understand what your are trying to do.. you want to dynamicly update your texture assets so it changes in game?
I think you do understand what the OP is trying to do. "Screenshot" is confusing the issue. It's really just "any image I find while running."
Answer by _Yash_ · Jun 29, 2016 at 01:32 PM
public string url = "file://<your image path>";
IEnumerator GetTexture() {
WWW www = new WWW(url);
yield return www;
// your texture is in www.texture variable
renderer.material.mainTexture = www.texture;
}
Answer by TheSurvival · Jun 29, 2016 at 05:34 PM
You press PrntScrn paste it into paint and then simply save it as a .png and drag it onto the assets then onto the object. Easy.
If you look lower in the question, the screenshot is being taken while the game is running, during Update when the player presses the X key. The Q is about how to use it without stopping the game.
No biggie. It's pretty common that the Q seems so obvious from the title that you forget to read the body, or you don't notice another answer which is a different way of writing what you were going to, etc... .
Your answer
![](https://koobas.hobune.stream/wayback/20220612083757im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
asset refresh 2 Answers
Allow user to download images from game assets 2 Answers
Refresh assets during build. 1 Answer
Remote access of Unity Asset Server? 3 Answers
Asset Server problems. Old updates appearing in updates list after deleting assets 1 Answer