Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by abalta · Dec 09, 2014 at 10:43 PM · updatinganimated

Update score animation

I want to update my score with animation like 2048. In this link (http://gabrielecirulli.github.io/2048/) you can play and see +4, +8 animated text while updating score.

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

3 Replies

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

Answer by f4bo · Dec 10, 2014 at 11:51 AM

there you go - I made a complete scene using a different approach than your


2048score.zip (134.7 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
avatar image abalta · Dec 10, 2014 at 12:02 PM 0
Share

Thanks this is exactly same as 2048 style, accepted.

avatar image
0

Answer by entropy phi · Dec 10, 2014 at 02:20 AM

Draw the "+Number" text over your score and move it up each frame. Reduce the alpha value each frame as well and it will have a fading effect just like that. Remove or reset it once it becomes invisible.

Comment
Add comment · Show 2 · 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
avatar image abalta · Dec 10, 2014 at 08:25 AM 0
Share

How can I set speed of animation?

avatar image abalta · Dec 10, 2014 at 08:28 AM 0
Share

You say remove or reset means setActive(t/f) ?

avatar image
0

Answer by abalta · Dec 10, 2014 at 10:19 AM

I made it. Codes are belowed.

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class AnimateText : MonoBehaviour
 {
 
         public Text txt;
         public float moveSpeed = 100.0f;
         public float alphaValue = 1.0f;
 
 
         // Use this for initialization
         void Start ()
         {
 
         }
     
         // Update is called once per frame
         void Update ()
         {
 
                 if (alphaValue <= 0.0f) {
                         txt.transform.Translate (new Vector2 (0, 0));
                         txt.enabled = false;
                         
                 } else {
                         txt.transform.Translate (new Vector2 (0, moveSpeed) * Time.deltaTime);
             
                         alphaValue -= Time.deltaTime;
             
                         txt.color = new Color (1.0f, 1.0f, 1.0f, alphaValue);    
                 }
     
         }
 
         public void Exit ()
         {
                 Application.Quit ();
         }
 
         public void Restart(){
         Application.LoadLevel (0);
     }
 }
 

Comment
Add comment · 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

27 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

Related Questions

Sprite animate on start ? 1 Answer

How do you make an object stay animated while moving? 1 Answer

SetTextureOffset Shader code 1 Answer

Update function won't update? 1 Answer

Updating minor versions 2018.2.0 to 2018.2.1 and Unity Hub 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