Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

taking a screen shot

Discussion in 'Scripting' started by gabrielh, Apr 6, 2008.

  1. gabrielh

    gabrielh

    Joined:
    Feb 24, 2008
    Posts:
    51
    Hi!

    For a save game I want to take a screen shot of what the player sees when pressing save (as done in almost any game around). I just can't find out the command on how to take a screen shot...
    Can anybody help?

    Thanks
    Gabriel
     
  2. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    Look in the documentation under Application.CaptureScreenshot
     
  3. gabrielh

    gabrielh

    Joined:
    Feb 24, 2008
    Posts:
    51
    hmm... unfortunately I am in the webplayer. Is there a work-around?
     
  4. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    In the web player you can't write files to the user's hard drive. That would be a serious security issue.

    What you can do is grab the screenshot and post to to some web server as an image. For an example, see WWW class docs.
     
  5. gabrielh

    gabrielh

    Joined:
    Feb 24, 2008
    Posts:
    51
    That's exactely what I need :)
    Thanks!