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

Is it possible to make screensaver with Unity?

Discussion in 'Editor & General Support' started by seuck, Jan 3, 2006.

  1. seuck

    seuck

    Joined:
    Jan 2, 2006
    Posts:
    1
    I like to build some 3D screensavers with Unity. I don't need user interaction, maybe some data retrieved from Internet.

    Is this possible? Mac and/or Windows?

    Thank you
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    (I think) not at the moment. However, such a publish option makes perfect sense at probably will appear in some future version.
    Windows note: actually a screensaver can have interaction with the user, just that usually they don't. In fact, a screensaver is just a program; with some options so that in can be previewed in the Display Settings. Even something like Word could theoretically be a screensaver :)
     
  3. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    I just wanted to bump this old thread because it would be awesome if Unity had the option to publish screensavers.

    I realize that the wiki explains how to create make a Mac screensaver from a Unity execuatble... but making screensavers for Windows is a different beast. The main problem is that there is no way to read command line parameters while in the Unity runtime. This means you can't tell if the screensaver is being ran in preview mode.
     
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    You used to be able to turn a Windows .EXE into a screen saver by simply renaming it to .SCR but I'm not sure what would be involved now a days. I started to look into doing this with a Unity standalone a while back but didn't get anywhere. Has anyone successfully done this? If so, how?
     
  5. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    the other option i thought of it actually writing a small screensaver prefspane that launches the unity player in fullscreen mode (based off current screen res). the player could live in the prefspane bundle, so would be fairly transparent to the end user. Something along the lines of what this does:

    http://www.themcdonalds.net/richard/software/appStartSaver/index.shtml

    But again none of these approaches I would recommend for a commercial product, for one both methods don't allow screen locking, and are mac only.

    Cheers.
     
  6. darklightstudio

    darklightstudio

    Joined:
    Mar 24, 2006
    Posts:
    14
    I'm actually experimenting with something like this in my spare time.

    I'm using Cocoa and the ScreenSaver + Webkit frameworks to just load a local page that embeds Unity or Flash. WebKit does all the work really.

    When I have more time to work on it and package it properly, I'll share the result.
     
  7. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    that approach is what is available on the wiki. and in my opinion not very robust. one the user will need the plugin installed to use it and two it doesn't protect the web-player very well. so for a commercial product someone could just open the package and remove the web-player and html file and do what they want with it.

    Cheers.
     
  8. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    You should look at "Creating Screen Savers" on the Unify Wiki at http://www.unifycommunity.com/wiki/index.php?title=Creating_Screen_Savers
     
  9. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    You can still do that (rename .EXE to .SCR) but the problem is that Unity built .EXEs can't read command line parameters, which means that the screensaver )the .exe) cannot determine if it should be running in Preview, Configuation or Normal mode.
     
  10. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
  11. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Annoyingly close to getting this to work.

    I packaged up a windows standalone exe and data folder using molebox and if I rename it to have a .scr extension then it runs when you double click it and runs full screen no problem (just set that as the default when building it) it even runs in preview mode when setting it as the screen saver, but when it actually runs for real it says the data folder is missing. Same thing happens even if I don't wrap it up with molebox. Windows must do something weird when it executes it.
     
  12. siggi-gross

    siggi-gross

    Joined:
    Apr 6, 2009
    Posts:
    56
    just a guess:

    execution folder for screen savers is c:\windows\system32 ? even if you browse is from elsewhere on your disk?

    does placing the whole .exe/.scr and datafolders in windows\system32 solve your problem?

    siggi

    edit:

    tried it with an exe from my own projects.
    - copied both exe and data folder to windows\system32
    - renamed the .exe to .scr
    - renamed the data folder exactly to what the error message complained (should be something like [YOURFILE]~1_Data, note that blanks are removed, all letters uppercase)
    --> worked fine :D (preview and real)

    P.S. I'm using XP
     
    webitube2 likes this.
  13. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Ah didn't think of that, so yes I put both the .scr and data folder in system32 but I didn't think to rename it as in the error message. Doh! cheers.
     
  14. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Annoyingly on Vista changing the name makes it work for real but not in preview where it still wants the long name. Meaning you need 2 copies of the data folder... well at least it kinda works.
     
  15. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    What also works is just naming it Data, downside to that is you can only have one in there. I guess the other option is to make sure the short and long names are the same all uppercase and less than 8 characters.
     
    webitube2 likes this.
  16. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Yup, using 8 character dos names seems to work for both preview and real. Cool beans.
     
  17. siggi-gross

    siggi-gross

    Joined:
    Apr 6, 2009
    Posts:
    56
    brave new world :wink:

    even some "new" windows7-features work on good old DOS-basis

    greets siggi
     
  18. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I'll have to test it on windows 7, you never know that might be different again.
     
  19. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I was also getting the `plugin not installed` message in the Unity wiki screensaver (OSX) even though Unity was installed. I think possibly it's because the screensaver's html page is a highly stripped down version and it perhaps wasn't compatible with the latest webplayer?

    Anyway, if you grab the sourcecode version of the screensaver from the wiki, you can overwrite the html file with the one generated from your new Unity application. You just need to be sure to change some things - copy the css `style` from the <body> tag, remove the <h1> title and the footer which links to downloading the plugin. Also you need to make sure the name of the unity file in the html file is the same as your actual unity file. In the wiki screensaver's html file it used saver.unityweb instead of saver.unity3d. It's okay to use .unity3d so long as the html file has that as the extension, AND you modify the screensaver framework's Objective-C code to reference the appropriate file name and extension. It gets kind of annoying when you're testing a new screensaver during development, to have to keep renaming whatever.unity3d to whatever.unityweb.

    Works for me, on Intel Mac 32-bit Leopard.
     
  20. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    Sorry to bump this again.

    I'm getting a "not compatible with this system" error when trying to use the wiki (MAC) files.

    I changed the HTML inside the package (just renamed my html to saver.html so it can find the .unity3d file instead of .unityweb file)

    when double clicking the Unity Screen Saver.saver it installs a saver in the systempref plane but immediately says it not compatible with my OSX 10.6...

    can anyone smart redo (i think) the binary file in the package...?
     
  21. unitydevist

    unitydevist

    Joined:
    Feb 3, 2009
    Posts:
    45
    I want to make screensavers with Unity too, has anyone else figured out the Snow Leopard issue?
     
  22. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    I want to make screensavers as well, where to get info?
     
  23. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    I'm working on a screensaver framework for Windows as mentioned in another thread, which should be available on the asset store in the next few weeks. As well as supporting launching in preview/config/fullscreen modes from a single exe it also provides a number of common screensaver features and also shows properly in the Windows screensaver dialog window. I will also be including some example screensaver effects for free which you'll be able to test before you buy the system.

    You can see my other thread here:
    http://forum.unity3d.com/threads/81...ws-soon-to-be-released!?highlight=screensaver

    As far as OSX goes there are problems because the screensaver system there is quite integrated with the o/s framework and since Snow Leopard it now has to be a 64-bit application, which Unity is not, and which some other languages cannot compile to, so it could be trickier to get things working there. My thought is to get a basic OSX screensaver compiled for 64-bit and 32-bit and have it launch an external unity app for fullscreen mode and maybe do the embedded webkit thing for the preview mode. But more research is needed.
     
  24. unity3dx

    unity3dx

    Joined:
    Apr 15, 2011
    Posts:
    175
    Not sure why making a Screen saver framework when it takes one line of code to get the command line argument on PC.
    This would display the command line on screen. Make it a script named commandline.cs and attach it to your camera.Then
    1- rename your program with SCR,
    2- copy it in /system32/ folder
    3- use windows to open the screen saver.
    You just have to compare with the command line arguments and load the setup screen, or the main program, in a window or full screen


    Code (csharp):
    1. using UnityEngine;
    2.  
    3. using System;
    4.  
    5. public class commandline : MonoBehaviour
    6. {
    7.     private string[] args;
    8.     void Start()
    9.     {
    10.         args = Environment.GetCommandLineArgs();
    11.     }
    12.  
    13. void OnGUI()
    14. {
    15.     GUILayout.BeginArea(new Rect (30,30,600,6000));
    16.     foreach (string argument in args)
    17.     {
    18.         GUILayout.Label(argument);
    19.     }
    20.     GUILayout.EndArea();
    21. }
    22.  
    23. }
     
    eric_unity45 likes this.
  25. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    858
    I'm trying to make a screen saver for Windows 7, but I keep running into the "Data folder not found" issue. The error panel says "There should be a 'Saver_Data' folder next to the executable". There IS, it is just not found. The app is named 'Saver.scr'.

    Any ideas?

    ~ce
     
    Last edited: Apr 16, 2013
  26. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    858
  27. VolureDarkAngel

    VolureDarkAngel

    Joined:
    Jun 27, 2013
    Posts:
    10
    Unity Screen Saver..... Sounds like a great plan....

    Unity will need to support multiple screens in full screen mode however...
     
  28. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
  29. firstuser

    firstuser

    Joined:
    May 5, 2016
    Posts:
    147
    Sorry to necro but, this would be super useful even in 2021. Any plans?

    Or maybe there is already a way, can someone share if they know anything that would help me get started?

    Information out there has been sparse and outdated.
     
    jzIsSumBuddy likes this.