I thought this might be due to an error in a custom controller I’m programming, but the problem still occurs when I try moving a Quad object with a BoxCollider2D component using a very simple script:
using UnityEngine;
public class Test: MonoBehaviour
{
private float speed = 1.5f;
private void Update()
{
float velocity = Input.GetAxisRaw("Horizontal") * speed * Time.deltaTime;
transform.Translate(new Vector2(velocity, 0));
}
}
Here’s a screenshot of the issue: Imgur: The magic of the Internet
As you can see, the BoxCollider2D and Quad mesh are not moving together. I have no idea why this is happening, but hopefully I’m just overlooking something.