Rigidbody 2D movement is Jittery
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float moveSpeed;
public float jumpHeight;
public Rigidbody2D rb2D;
// Use this for initialization
void Start ()
{
rb2D = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update ()
{
}
void FixedUpdate ()
{
Move ();
}
void Move()
{
if(Input.GetKeyDown(KeyCode.Space))
{
rb2D.velocity = new Vector2 (0, jumpHeight);
}
if(Input.GetKey(KeyCode.D))
{
rb2D.velocity = new Vector2 (moveSpeed, rb2D.velocity.y);
}
if(Input.GetKey(KeyCode.A))
{
rb2D.velocity = new Vector2 (-moveSpeed, rb2D.velocity.y);
}
}
}
So I've tried making a simple platformer, a square cube moving around, however after going left or right for 3-5 seconds the cube (the player) starts to micro-stutter and becomes jittery, its not a very big issue but it is a big pet peeve of mine.
I doubt this is a hardware related issue but who knows, if anyone has some idea what could cause this it would be a great help.
I am not very experienced with Unity so pardon if I have made any obvious mistakes or if you see something else that you think could be improved please tell me I can take criticism!
Your answer
Follow this Question
Related Questions
Character Controller jittering with other colliders 0 Answers
How to fix the player/collision glitch? 0 Answers
my box movements look jitter, how to fix it 0 Answers
Rigidbody jittering (Interpolation set on) 0 Answers
2d sprites jittering when I rotate. 0 Answers