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 epic1legend · Jul 06, 2014 at 06:13 AM · androidbuildnot working

Unity android game not working in build.

I have a simple android game with spinning rings and a ball that must go through holes in the rings. The rings grow after spinning for so long. It work perfect in the editor, but in the build the rings sometimes grow different amounts. why? please help, i'm flustered by this.

javascript for the circles:

 #pragma strict
 
  var T : float = 1;
  var collideColor : Color;
  var normalColor : Color;
  var added : boolean;
  var kill : boolean;
  var closed : boolean;
  var rotSpeed : float;
  var totT : float;
  var flashing : boolean;
  var R : float;
  var growing : boolean;
 
 function Start(){
     transform.localEulerAngles = new Vector3(0,0,180);
 }
 
 function Update () {
     totT = GameObject.Find("Player").GetComponent(Timer).totalT;
 
     if(GameObject.Find("Player").GetComponent(Timer).stage == 3){
         Scale();
     }
     if(GameObject.Find("Player").GetComponent(Timer).stage == 1){
         Go();
         addRound();
     }
     if(GameObject.Find("Player").GetComponent(Timer).stage == 2){
         Flash();
     }
     
     if(T == 5){
         renderer.material.color -= new Color(0,0,0,.10f);
     }
     if(T == 6){
         Destroy(this.gameObject);
     }
 }
 
 function Go(){
         R = T;
         rotSpeed = Mathf.Log(totT, 1.3) * 30;
     
     if(T == 4 && closed == false){
         gameObject.GetComponent(Animator).Play("close");
         closed = true;
     }else{
         if(GameObject.Find("Player").GetComponent(Timer).totalT == 1 || GameObject.Find("Player").GetComponent(Timer).totalT == 2){
             transform.Rotate(Vector3.forward * Time.deltaTime * 200);
         }
         
         if(T == 1 || T == 2){
             transform.Rotate(Vector3.forward * Time.deltaTime * 50);
         }
             
         if(T == 3){
             transform.Rotate(Vector3.back * Time.deltaTime * rotSpeed);
         }
     }
 }
 
 
 
 function Scale(){
     if(growing == false){
     growing = true;
     added = true;
     transform.localScale += Vector3(0.02 * (R / 1.7),0.02 * (R / 1.7),0);
     yield WaitForSeconds(.01);
     growing = false;
     }else{
     return;
     }
 }
 
 function Flash(){
     if(T == 3){
         if(GameObject.Find("Player").GetComponent(Timer).stage == 2 && flashing == false){
         flashing = true;
         renderer.material.color = collideColor;
            yield WaitForSeconds(.2);
            renderer.material.color = normalColor;
            yield WaitForSeconds(.2);
            flashing = false;
            }
     }else{
     return;
     }
 }
 
 function addRound(){
     if(added == true){
         T += 1;
         added = false;
     }else{
     return;
     }
 }
 

javascript for the timer:

 #pragma strict
 
 var totalT : float = 1;
 var stage : float;
 var circle : GameObject;
 var spawn : boolean = true;
 var rotTime : float = 2;
 var end : boolean;
 var flashTime : float;
 
 var ranRotTime : float;
 var ranRotDir : int;
 var waitTime : float;
 
 function Startpress(){
     timerTwo();
 }
 
 function Randoms(){
     ranRotTime = Random.Range(Mathf.Log(4.5, (totalT + 5)) * 8, Mathf.Log(4.5, (totalT + 5)) * 8 - 2);
     
     waitTime = Mathf.Log(1.4, (totalT + 1)) * 13;
 }
 
 function timerTwo(){
     Randoms();
     end = false;
     Instantiate (circle, Vector3(0,0,-2), Quaternion.identity);
     stage = 1;
     if(totalT == 1 || totalT == 2){
         yield WaitForSeconds(rotTime);
         }else{
     yield WaitForSeconds(ranRotTime);
     }
     timerOne();
 }
 
 function timerOne(){
     stage = 2;
     if(totalT == 1 || totalT == 2){
     yield WaitForSeconds(0);
     }else{
     
         if(totalT >= 3){
         audio.Play();
         audio.loop = true;
         yield WaitForSeconds(waitTime);
         }
         
     }
     audio.loop = false;
     timerThree();
 }
 
 function timerThree(){
     stage = 3;
     yield WaitForSeconds(.51);
     endTimer();
 }
 
 function endTimer(){
     end = true;
     totalT += 1;
     timerTwo();
 }
 
 function OnTriggerEnter2D(other: Collider2D) {
     GameObject.Find("Restart").GetComponent(restart).dead = true;
     Destroy(this.gameObject);
 }
 

SORRY I DON'T TYPE WELL WHEN I'M FLUSTERED.

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

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Multiple EasyAR ImageTracker in different Unity scenes 0 Answers

Can you Build Unity3d Scenes using "-nographics" command line argument 0 Answers

Distribute terrain in zones 3 Answers

Transform.position not working properly? 2 Answers

Game works great, then i build and run, it no longer works. 1 Answer


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