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);
}
}
}