- Home /
Skybox Movie Texture
In Unity 3.5, When i apply a movie texture to any object, i usually add a script with it to play the movie when the game is running. But now i added 6 movie textures to a skybox and I dont know how to access this texture from the script..
How do i access skybox from the script and play the movie?
Answer by JanTuts · Jan 03, 2013 at 01:25 AM
The MovieTexture.Play() function will tell the actual video itself to play, not just the MovieTexture you declared, so it doesn't matter where you tell it to play.
// Add this script to any game object in your scene (preferably your Main Camera)
// Attach the same 6 videos you used in your skybox to the 6 slots of this array
var movies : MovieTexture[] = new MovieTexture[6];
// As your scene starts, this script will then iterate through those videos
// and set them to loop and make them start playing
function Start(){
for (var movie in movies) {
movie.loop = true;
movie.Play();
}
}
It works man, thanks a lot... You are great!!! but However i dont have any good dynamic sky movie, is there anywhere i can download those?
Sorry, I have no idea where you could get one. :/ All I could find were live-rendered dynamic skyboxes, which might even be better suited for your needs: http://www.pixelstudio.nl/?p=190
To make a video skybox, I can think of 3 methods, all of which are long, hard work and which are not advised if you are new to any of those fields of design:
1/ Use 3D program like Cinema 4D (or $$anonymous$$aya / 3ds $$anonymous$$ax) to set up a looping animation of clouds, etc. using textured meshes (or in the case of Cinema 4D: live rendered particles!). Then you'd just set up 6 cameras in the scene in a cube formation, make sure their views overlap a bit and render the 6 videos. You can then crop them to size in a video editing program like Adobe Premiere of AfterEffects.
Probably the best option, as you could design any skybox you'd want and make it loop perfectly, but it requires 3D modeling/animation or particle FX skills to pull it off correctly.
2/ Hand-animate: draw each frame of each texture frame-by-frame
A viable option if you're already good at hand-animating. If you're not, steer away from this method, because it's the highest labour-intensive method
3/ Set up a whole bunch of video cameras outside and make sure their views overlap. Let them film for some time, then sync them up in your video editing program. Then export each video as a PNG or JPG sequence. Then you would use a skybox stitching program to make a skybox for each frame. Then use those 6 image sequences to make a movie again your video editing program.
Probably the least favourable option, given that you'd need a load of camera, it's a lot of work + render time and your skybox wouldn't even loop correctly...)
Of the three ways u mentioned, Cinema 4D and after effects seems to be the correct way to go, but unfortunately im new to both of them.. Well then i have to start learning 3D modelling from now on... Thank you very much for taking the time to explain it..
Like I said: if it's possible for your project in terms of render-intensity, you could always check out PixelStudio's live-rendered "skydome" http://www.pixelstudio.nl/?p=190
And yeah, looks like we're never done learning... Every time you think something's going to be easy, it turns out there's still a long wait to go. But at least Unity has the Wiki, Forms and Answers! :D The Community constantly helps me out, so I'm glad to return the favour for once, even if it didn't get you that much further this time... :/
Your answer
![](https://koobas.hobune.stream/wayback/20220613085327im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
downloding movie texture 2 Answers
Texture compression Skybox seams 1 Answer
Creating a space skybox scene 1 Answer
Dynamically changing skybox texture 0 Answers
Play movie in full screen 1 Answer