- Home /
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);
}
}
}
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.
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.
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 !