Hello,
I have a big problem here,
I have a character which moves at 5m/s. When the movement occurs on my PC everything works fine but when I run it on my Android device everything is slower.
By Slower I mean it takes more than 1s to make 5m. Even if I multiply by Time.deltaTime or Time.fixedDeltaTime (for FixedUpdate).
At first I though it was only the animations but it seems its the whole time management. (Here is my post about the animation part : https://forum.unity.com/threads/animation-slower-on-android.510731/
Here is my code for the simple movement.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MovementTest : MonoBehaviour {
public float amplitude = 20;
public float speed = 2;
private float dir;
private float start;
private float pos;
// Use this for initialization
void Start () {
start = transform.position.z;
pos = start;
dir = 1;
}
void FixedUpdate () {
pos += dir * Time.fixedDeltaTime * speed;
if(pos > start + amplitude)
{
pos = start + amplitude;
dir = -1;
transform.Rotate(Vector3.up, 180);
}
else if(pos < start)
{
pos = start;
dir = 1;
transform.Rotate(Vector3.up, 180);
}
transform.position = new Vector3(transform.position.x, transform.position.y, pos);
}
}
Thank you for your help.