Scrolling Credits. How?

Hi everyone,

I’m trying to create a scrolling credits effect.
I have a scene with a GUI Texture (set to scale 1,1,1)(X=0.5,Y=0.5,Z=0) which is the background picture and I wanted to have the credits scroll up over the top of this. I’ve been trying the GUI Text options and a few other things but nothing comes even close to what I have in my head.

If anyone can help, I would appreciate it.
Thanks

Hello Andy.

I’ve found one easy way to do this is to have the credits as a texture on a plane. You then simply use Unity’s built in animation editor to achieve the scrolling effect. Either by moving the camera over the plane, or the plane by the camera.

I might be being a bit thick here so please bear with me.

I just tried moving the GUI texture (the background picture) back to Z=1, then added a plane in front (Z=0, however when I ran it, it didn’t show the plane.
Camera is at Z=-10 facing the plane/GUI Texture.
What did I do wrong?

If the credits are all in one GUIText object, just set the Y position so it’s positioned off the bottom of the screen, and then do a loop with transform.Translate until it’s scrolled off the top (or set transform.position directly).

–Eric

Hi Eric,

Right I put the GUI Text just in front of the GUI Texture layer but now I’m only getting parts of the text coming through. It doesn’t matter where I put the GUI Text on the Z axies just parts of the words come through.

Can you post the code you are using for this?

Well, I finally got to see the text. (Had to restart unity).

The code I am using is

var creditscroll: int;

function Update () {

if(Time.timeScale ==1.0) {
Time.timeScale =0.002;}

Time.fixedDeltaTime = 0.002 * Time.timeScale;

transform.Translate(Vector3.up * Time.timeScale);

if(transform.position.y >= 1.80){
Destroy(gameObject);
}
}

So I parented each line of text to the one above, then use the script to move the main parent up.
The only problem is that it works fine inside unity but when I build the project it shots past to quickly. It does seem to matter what I set it at, in the stand alone it flys by whilst inside unity it plays right.

You need to use Time.deltaTime. Time.timeScale is something completely different.

Thanks Andeeee. Sorry for the delay. Didn’t get a thread reply message.

That’s sorted it. Thanks to everyone that answered

Hi guys,

I wanted to share my approach. I created a script that takes an array of GUIText elements. The GUIElements are just GUIText objects parented with an empty object (“Credits”) with position 0,0,0. Each GUIText object has the right start position (default position is x: 0.5, y: 0,5 and Z:0). Then you can have as many elements as you want and you can start with the first one at the center, and the others with a “-1.5” on the Y axis, so they are off the screen. The script has a start display timer and a start scrolling timer, and also the scrolling speed the GUIText will scroll.

Here’s the code of the script:

using UnityEngine;
using System.Collections;

public class ScrollingGUIText : MonoBehaviour {

	/* Public Variables    */
	
	// The array of GUIText elements to display and scroll
	public GUIText[] textElements;
	
	// The delay time before displaying the GUIText elements
	public float displayTime = 5.0f;
	
	// The delay time before starting the GUIText scroll
	public float scrollTime = 5.0f;
	
	// The scrolling speed
	public float scrollSpeed = 0.2f;
	
	// Update is called once per frame
	void Update () {
	
		// start display count down
		displayTime -= Time.deltaTime;
		
		if (displayTime < 0)
		{
			// if it is time to display, start the scrolling count down timer
			scrollTime -= Time.deltaTime;
		}
			
		// if it is time to scroll, cycle through the GUIElements and 
                // increase their Y position by the desired speed
		if (scrollTime < 0)
		{
			foreach (GUIText text in textElements)
			{
				text.transform.Translate(Vector3.up * scrollSpeed);
			}
		}
	}
}

Hope it helps.

Cheers!

See [link redacted by mod since it expired]

Nice! Thank you, leviMH!

hello leviMH,
Can you give me direct link of credit because i can’t update unity 3.4.
Thank you in advanced.

var y : float = 500.0.;

function Start () {

}

function Update () {
y = y -1;
OnGUI ();
}
function OnGUI () {

GUI.Label(Rect((Screen.width/2)-40,y,200,50),“Directed By”);
GUI.Label(Rect((Screen.width/2)-40,y+20,200,50),“Børge Truelsen”);
}

this works on my computer

Why are you bumping a year old topic?