- Home /
Question by
Aleksander_T · May 27, 2020 at 08:21 AM ·
movementbugrigidbody2d
Character during moving has blur effect and shakes. How can I fix it?
this is my code:
public class PlayerMovement : MonoBehaviour
{
[SerializeField] private float speed;
private Rigidbody2D rigidbody2D;
private Vector2 axisInput;
private void Start()
{
rigidbody2D = this.gameObject.GetComponent<Rigidbody2D>();
}
private void Update()
{
axisInput.x = Input.GetAxisRaw("Horizontal");
axisInput.y = Input.GetAxisRaw("Vertical");
axisInput.Normalize();
}
private void FixedUpdate()
{
rigidbody2D.velocity = axisInput * speed;
}
}
and link to viedo: https://drive.google.com/file/d/1TWt8fLeJnZVE8_JAECHH0PF-hDiQNjzf/view?usp=sharing,
Comment