Hello Forums
I apologize for posting this when it has been asked before but none of the other solutions seem to help with my problem.
I have been working in Unity for what’s going on two years and today is the first time I’ve started moving to Unity5, I also haven’t been working with Unity for about 2 months. The project I had been working on was a shmup and to warm back up with Unity I wanted to make a quick Galaga clone but I ran into an issue.
The first issue is that in the editor with the white sprite and the black background I noticed a somewhat minor stutter when the ship could begin moving left or right. Not really like lag but more like it would go to it’s next position and then take a very minor hop back. I naturally began searching the forums.
After an hour long search I ended up messing around the vsync and code with no real avail. vsync seems to have something to do with it but no matter what setting I changed it to the problem still remained. Eventually I built the game and ran in a PC environment and the stutter did not seem to be there so all was well. I could deal with it just being in the editor but then I built it on the web and the problem returned.
So I reset everything, unity, my computer, and the entire project and begin with the most basic shmup scene I could put together. The stutter remains.
I uploaded a video on youtube and if you put it on the 720p/60fps setting the stutter should be clear.
Here is the only script of code that is in the game –
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour
{
void Update ()
{
if (Input.GetKey("right"))
{
transform.Translate(Vector2.right * 5 * Time.deltaTime);
}
if (Input.GetKey("left"))
{
transform.Translate(-Vector2.right * 5 * Time.deltaTime);
}
}
}
I’ve also tried
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour
{
void Update ()
{
if (Input.GetKey("right"))
{
transform.position += new Vector3(1 * 5 * Time.deltaTime , 0, 0);
}
if (Input.GetKey("left"))
{
transform.position += new Vector3(-1 * 5 * Time.deltaTime, 0, 0);
}
}
}
I have two monitors and it looks the same on both.
Anyways I could use some advice.
On a side note I’ve been trying to look up guides on optimizing movement and an analysis of movement options but I haven’t found anything other than pixel perfect movement which isn’t necessarily what I’d like to see.
Thanks for any help from Jesse Bergerstock or “illMadeCoder”.