In Game Credits?

Hi Guys,
So I Have nearly finished my Main Menu GUI Screen!
But I would like to add a credits scene.

So I have already made the code so when the player clicks the Credits button it loads up a separate scene but I can’t work out the script to make the actual credits e.g Created by… (then next line) Music by… etc.

  • That way I will be soo close to
    finishing the main menu screen :smiley:
    Thank you in advance to anyone who
    can help!
    -Izzy

This very simple credits scroller should get you started.

using UnityEngine;

public class Credits : MonoBehaviour
{
    private float offset;
    public float speed = 29.0f;
    public GUIStyle style;
    public Rect viewArea;

    private void Start()
    {
        this.offset = this.viewArea.height;
    }

    private void Update()
    {
        this.offset -= Time.deltaTime * this.speed;
    }

    private void OnGUI()
    {
        GUI.BeginGroup(this.viewArea);

        var position = new Rect(0, this.offset, this.viewArea.width, this.viewArea.height);
        var text = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Quisque a mauris sit amet neque posuere molestie at laoreet lorem.
Suspendisse accumsan pretium ante, sit amet tincidunt tortor tempor ac.
 
 
 
Sed condimentum mi id nisi egestas non vulputate urna porttitor.
Mauris sed mauris vitae velit imperdiet vulputate ut nec velit.
Maecenas convallis posuere velit, quis interdum justo mattis vel.
 
 
 
Aliquam hendrerit ullamcorper dui, a laoreet dolor ornare sit amet.
Praesent sed odio purus, a convallis tellus.
Nulla porttitor arcu vel ipsum luctus euismod.
 
 
 
Duis tincidunt vehicula nisl, nec venenatis velit convallis non.
Sed semper metus egestas libero venenatis imperdiet.
Pellentesque venenatis orci nisi, vel fringilla dolor.
 
 
 
Nam at lacus massa, commodo pellentesque velit.
In accumsan velit sed nisi aliquam tristique.
Ut eu quam tellus, eu egestas diam.
 
 
 
Maecenas vel dui vitae orci accumsan molestie.
Donec pulvinar metus nec turpis rutrum quis gravida ante dignissim.
Ut quis justo quis nisl eleifend ornare non at ipsum.";

        GUI.Label(position, text, this.style);

        GUI.EndGroup();
    }
}

Use the style to make the default font larger (about 24px?), change the color so the text is visible on your background and set the alignment to Top/Center.

Good luck with it.