Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by SSpecks · Dec 02, 2019 at 08:14 PM · textmovemove an objectobject movement

How do I make text move up?

I am making a credit reel in my game. When the CREDIT button is clicked, I want the names to slide up the screen. I do not want to animate it, because I have yet to touch the Unity Animation Software and do not want to start, unless it is the only way. Is there anyway to call the CREDIT text and make it move up a certain number of pixels after every second in a float or such?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Sgt_Spike · Dec 02, 2019 at 11:31 PM

Yes this is indeed possible. Here's the code I used for my old game. You may need to improve some parts but it should work.

     public Scrollbar creditRoll;
     private bool isRolling;
     private bool startCredits;
 
     private void Start()
     {
         startCredits = false;
         isRolling = true;
         creditRoll.value = 1f;
         InvokeRepeating("RollCredits", 0f, 0.0002f);
     }
 
     public void CallCredits()
     {
         startCredits = true;
     }
 
     private void RollCredits()
     {
         if (startCredits == true)
         {
             if (isRolling == true)
             {
                 if (creditRoll.value > 0.02f)
                 {
                     creditRoll.value = creditRoll.value - 0.00005f;
                 }
                 if (creditRoll.value == 0.02f || creditRoll.value < 0.02f)
                 {
                     StartCoroutine("FinishCredits");
                     isRolling = false;
                 }
             }
             else
             {
                 return;
             }
         } else
         {
             return;
         }
         
     }
 
     IEnumerator FinishCredits()
     {
         yield return new WaitForSeconds(6f);
         // add code for finishing credits (return main menu, etc.)
     }

The 0.00005f inside the code determines how fast it will run. You can change this to a pre-defined float if you wish for more efficiency.

If you need help setting up the UI, here's the layout I used:

alt text

  • UICanvas is a canvas

  • Credits is a panel (Used for background)

  • Scrollrect is an empty gameobject (With components mask and scrollrect)

  • Content is an empty gameobject (Used to contain your data, you can add components to organise it)

  • Scrollbar is a vertical scrollbar (May want to make it transparent)

For your scrollrect component, set the content object to (content object), and the vertical scrollbar to your scrollbar.

Hopefully that all works for you. You may want to look into Unity animation soon though. It's not really as hard as it looks and animations are great :D Good Luck!


unitytest.png (3.5 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

195 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Move UI with / corresponding Game Object? 1 Answer

Move player based on UI controls 0 Answers

How could I make an object move from left to right and it will come back from right? 0 Answers

I want to create an object that only moves if i click in others 4 objects that i have in the scene 0 Answers

Player (box) movement is shaky (visual only) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges