Glitchiness with transform.Translate function

Hi there,

I’m experience some glitchiness with the transform.Translate function. I have the following code written in my Update function in a script that is attached to a quad in my project:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
      
    }

    // Update is called once per frame
    void Update()
    {
        transform.Translate(0,-5 * Time.deltaTime,0);
    }
}

And when I run the project the game object moves down the Y axis but it stutters quite significantly at the beginning. Here is a video of the stuttering effect that I see here:

This has only started happening recently in my projects and I’m wondering whether it’s a hardware issue or something? Is there anything I can do to get rid of the stuttering effect?

Any help would be appreciated

The framerate is always quite variable when you first hit play in the editor as there’s a lot of other processes going on still. It’s also incredibly easy to visually pick out this kind of stuttering when there’s only a single object on the screen with no background.

1 Like

Test this kind of thing in a build, since the Editor has a lot of other stuff going on when you hit Play. If you’re still seeing it with a build you can use a dev build and connect to the profiler to record what is happening.