Right now I know Time.deltaTime in the Update function is pretty on point when it comes to measuring real time. I have a project where I am using transform.Translate(velocity * Time.deltaTime) in the Update function to move the player. The issue I am having is that I am trying to change my velocity (float variable) to a different amount at a specific time regardless of frame rate or frame rate changes. As in, after starting the scene: change velocity from 14.25f to 13.5f at 5/60 of a second, and then change velocity to 12.75f at 7/60 of a second, and then change velocity to 12f at 11/60 of a second, etc.
.
I made the quick script below to try and better show how I am doing movement at the moment.
.
If it matters, I plan to run my project at 60 frames per second, and I temporary changed the project’s Fixed Timestep to 0.01666667f to help me check the players transform position at a rate close to 60fps by pausing the scene and using the skip button in the editor to move the game one frame at a time.
.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TempMove : MonoBehaviour
{
public Vector3 velocity;
void Start()
{
velocity.y = 14.25f;
}
void Update()
{
transform.Translate(velocity * Time.deltaTime);
}
}