I have been working on a top down puzzle game for a little while now, I have created animations for the game and I have used the unity animation tab to put them into unity, I followed a few tutorials on youtube, one of which by the same person who I followed the coding tutorial to code the movement in the first place, to get directional animations to work, but even then, it just does not seem to work, I am puting my movement code in, also sorry about any typos if any exist, my “d” key insists on either detecting 2 hits or no hits.
public Rigidbody2D rb;
public float moveSpeed = 5f;
Vector2 movement;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
Debug.Log("Hello, Player!");
}
// Update is called once per frame
void Update()
{
//Input
movement.x = Input.GetAxisRaw("Horizontal");
movement.y = Input.GetAxisRaw("Vertical");
}
void FixedUpdate()
{
//Movement
rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
}