Hello everyone,
I’m currently working on a 2D game in Unity and I’ve been facing issue with my background appearing jittery during player movement. I’m using a Rigidbody2D
for the player, Pixel perfect component for the camera and a Cinemachine
camera to follow the player. However, despite my efforts to achieve smooth movement, the background become noticeably jittery when the player moves. Here is more information:
-
My rigidbody interpolation is set to interpolate.
-
My pixel perfect camera ppu is 32 same as my sprites ppu
-
My game resoultion is 1920x1080 so i use 470x280 refrnece resoultion
-
Im using defualt cinemachine brain settings and no damping on my virtual camera
-
Im using the cinemachine pixel perfect extension but its not seem to do anything
-
This is how i move my player:
public class Player : MonoBehaviour
{
public float moveSpeed = 5f;
Rigidbody2D rb;
Animator anim;
Vector2 movement;
private void Awake()
{
rb = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
}
void OnMovement(InputValue value)
{
movement = value.Get<Vector2>();
}
private void FixedUpdate()
{
rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
}
}
I tryed to solve this issue for so long but nothing appear to help i would realy appreciate if someone will help me fix this problem thanks.