• 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 Zeeness · Sep 02, 2018 at 11:33 AM · buttonplayer movementuser interfacebutton trigger eventsdevices

My character takes time to move on certain devices

Hey everyone, i have a problem with my character "Cube", so in my first device(HTC One M7), the cube is moving instantly when i press the UI button, but in my second device (Google Pixel 2) the cube doesn't react in time, and that means the cube takes time to respond to move, it's like 0.5 second and it's really unplayable. here is my script

 using UnityEngine;
 using UnityStandardAssets.CrossPlatformInput;    
 
 public class PlayerController : MonoBehaviour
 {    
     public Rigidbody rb;
     float directionX;
 
     public float forwardForce = 2000f;
     public float sidewardForce = 1000f;
 
     private void Start()
     {
         rb = GetComponent<Rigidbody> ();
     }
     void Update()
     {
         directionX = CrossPlatformInputManager.GetAxis ("Horizontal");
     }
 
     // Update is called once per frame
     void FixedUpdate()
     {
         rb.AddForce(0, 0, forwardForce * Time.deltaTime);
 
         if (Input.GetKey("d"))
         {
             rb.AddForce(sidewardForce * Time.deltaTime, 0, 0);
         }
         if (Input.GetKey("a"))
         {
             rb.AddForce(-sidewardForce * Time.deltaTime, 0, 0);
         }
         {
             rb.AddForce (directionX * sidewardForce, 0, 0);
         }
     }
 }




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
0

Answer by Zeeness · Sep 02, 2018 at 12:10 PM

Well, i fixed my problem, i just turned off the magnification with triple-tap on my device. i will let my post up so if anyone gets the same problem.

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 Pinkuboxu · Sep 03, 2018 at 03:42 AM 1
Share

Good that you found it. If you think it should normally work with magnification on, then you may be good posting it as a Unity bug. I don't have a way to test this out but it sounds like a phone feature isn't being treated correctly by the Unity Engine in that device case.

avatar image Zeeness Pinkuboxu · Sep 03, 2018 at 11:18 AM 0
Share

I didn't think of that to be honest, thanks for the idea, i will post it as a Unity bug, you may be right !

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

106 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

Related Questions

Highlight images in buttons children 0 Answers

Hidden Canvas, doesn't disable interaction with buttons. 1 Answer

Problem with button On Click 1 Answer

Create a button to instantiate and drag GameObject 1 Answer

how to create a button that call to action a website 0 Answers

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