• 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 DFiable · Sep 14, 2011 at 06:57 PM · androidguibuttontouch

Button reaction time problem

I'm developing on Android and I have the Pro version. When I touch the Play button in my first scene there is a 2 second delay before the second scene loads. Does anyone know why I'm getting this delay? I have a feeling my script might not be set up right. Is there a more effecient way to create a button with a GUI Texture? I've noticed on other games that the button reaction time is much faster than any of my buttons. An suggestions? thanx

here's my button script:

 function Update(){
 if(Input.touchCount > 0){
 
     var touch: Touch = Input.touches[0]; 
 
     if(touch.phase == TouchPhase.Began && guiTexture.HitTest(touch.position)){
         Application.LoadLevel("sk6");
        var underGUI : GUITexture;
        underGUI = GetComponent(GUITexture);
           underGUI.enabled = false;
          
        } 
        
    }
 }
Comment
Add comment · Show 2
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 DFiable · Sep 14, 2011 at 07:04 PM 0
Share

Also, the first collision(crash and die) in my scene is also very slow to respond. After the second and third time a player dies(collision) it works perfectly. Any suggestions why thats happening?

avatar image BerggreenDK · Sep 14, 2011 at 08:51 PM 0
Share

perhaps its a build setting like the webplayer has streamed? if you enabled streamed in webplayer, the first level loads into memory and then the rest comes late. What you explain sounds to me like caching/memory that is ready 2. and 3. time.

1 Reply

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

Answer by syclamoth · Sep 15, 2011 at 01:52 AM

Well, Application.LoadLevel is hardly a quick operation! If you use LoadLevelAsync instead, then you won't get the 2-second lag- it'll just wait until the level is loaded and then smootly shunt you into it. The 2-second delay is the time it takes to load the level, but if you're on Unity Pro, there's no reason why you can't use the Asynchronous version instead.

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 DFiable · Sep 15, 2011 at 04:09 PM 0
Share

Awesome Thank you!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Switching a GUIbuttons texture when holding your finger on it? 1 Answer

Android touch gui help!!! 2 Answers

Android GUITexture Touch 0 Answers

Holding GUI Button Touch to Rotate Object 0 Answers

Why this simple code doesnt work? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges