i get TimeSpan from server. It contains a period of enemy movement from point A to point B.
using Vector3.Lerp, i am doing movement A → B
private Vector3 _start;
private Vector3 _finish;
private float _time;
private System.TimeSpan _deltaTime;
public static void Instance(){
//create GO and initialize variable
}
void Start(){
_time = Time.time;
}
void Update(){
float interpolate = (Time.time - _time) / (float)_deltaTime.TotalSeconds;
gameObject.transform.position = Vector3.Lerp(A,B,interpolate);
}
but Timer on screen and enemy movement are out of synchronized,
enemies are moving very slowly…