Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by g__l · Oct 28, 2015 at 12:38 PM · touchlagdeviceunity remotetouches

How do i get rid of touch lag between touch ending on device and action in game? Or is it possible, on Unity Remote 4 using Nexus 7 2012 with if (Input.touchCount > 0) for touch input?

Having struggled with touch input in games and testing games on an android device i have been using using unity remote 4 on a Nexus 7 2012 (1st Gen) and to master touch input i have been using if (Input.touchCount > 0) on a UI Button which seems to solve my problem as whenever i touch the screen Input.touchCount equals 1 and that works, my code is below;

 public class Left : MonoBehaviour {
     GameObject car;
     int speed = 100;
 
     // Use this for initialization
     void Start ()
     {
        car = GameObject.Find("Car");
     }
 
     // Update is called once per frame
     void Update()
     {
         if (Input.touchCount > 0)
         {
             car.transform.Rotate(Vector3.up * Time.deltaTime * speed);
             Debug.Log("LEFT");
         }
     }
 }

It is very simple code which is easy for me than confusing event managers or other ways to do touch input. But the problem is when I release touch on the button which this code is attached to, both the car rotation and debug logging of "LEFT" continues for a short period, at least one second which could be catastrophic for me when i create simple games focused on reaction.

Thank you for reading my question, I would hope their is a solution to avoid the lag or I can blame it on my old device and unity remote, meaning it would work if i actually released it. Opinions or answers would be much thanked!

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 g__l · Oct 28, 2015 at 01:02 PM 0
Share

I tried get rid of speed by changing Vector3.up to new Vector3 (0,25,0) as i thought speed may prolong the rotation but a larger vector 3 may still increase the rotation

avatar image g__l · Oct 28, 2015 at 07:30 PM 0
Share

If this is just how it is, having struggled to find decent guidance on testing apps through android studio, could someone direct me to information on how to test my apps, I guess through android studio. Thanks,

1 Reply

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

Answer by g__l · Aug 04, 2016 at 02:07 PM

[I later discovered] Unity Remote 4 will never be perfect as it is not the app itself, hence the code doesn't matter. In order to test an app i recommend building an apk of your app, placing it on your mobile device, and then, by use of a file explorer app, opening and installing it manually for no lag (unless of course the code is very demanding).

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

33 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

Related Questions

Touch Input only working on Unity Remote 0 Answers

EventSystem.Update() lag spike in profiler on first call 1 Answer

device.present lag iOS iPad1 0 Answers

Touch are laggy on ipod touch(4th gen.) 0 Answers

Unity 4.6 Game lags on only on the first touch, after it is fine? 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