- Home /
How would you make a simple still image cutscene?
I've looked for tutorials but they all are for animations... I want just a simple slideshow between levels, kind of like angry birds, to help the storyline. Would I need a separate scene, or a GUI thingy?? I don't even know where to start.
Answer by Waz · May 23, 2011 at 04:07 AM
If all you're doing is showing some images, just do it in the OnGUI() function of a top-level object in your scene, by using GUI.DrawTexture(). So, something like:
var frames : Texture[];
var frameTime = 3.0;
private var frame=0;
private var nextFrameTime = 0.0;
function OnGUI()
{
if (frame < frames.Length) {
if (Time.time >= nextFrameTime) {
frame++;
nextFrameTime += frameTime;
}
GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),frames[frame]);
}
}
How/when you start the animation depends on the rest of your game. You could just use the active state of the GameObject.
Note that for a WebPlayer game, you may still be better using those 3D tutorials - you're going to pay more for the single-use cutscene images than you would to make a 3D animated scene using your existing assets.
Your answer
Follow this Question
Related Questions
How can I move Text and Image component in unison inside of Canvas 0 Answers
slowly make gui image more transparent 2 Answers
How do I trigger GUI elements 1 Answer
Image overlay in center of screen 2 Answers
Showing .png on button press 1 Answer