When ever I start the game the player starts in the center and wont move away from the center. Even when moved some where else the player still starts in the center
player script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playermovement : MonoBehaviour
{
public float movespeed = 5f;
public Rigidbody2D rb;
public Animator animator;
Vector2 movement;
void Update()
{
movement.x = Input.GetAxisRaw("Horizontal");
movement.y = Input.GetAxisRaw("Vertical");
animator.SetFloat("Horizontal", movement.x);
animator.SetFloat("Vertical", movement.y);
animator.SetFloat("Speed", movement.magnitude);
}
private void FixedUpdate()
{
rb.MovePosition(rb.position = movement * movespeed * Time.fixedDeltaTime);
}
}