Vector2 inputDirection = input.normalized * 5f;
Vector2 moveDirection = rb.position + inputDirection;
Vector2 move = Vector2.MoveTowards(rb.position, moveDirection, 10f * Time.deltaTime);
rb.MovePosition(move);
My intention is to move a game object a specific amount of Unity units at a specific speed, in the direction of the 8-way input movement on a controller or keyboard.
With this code, I thought I was taking the movement input and adding 5 Unity units onto the direction and then moving the game object’s rigidbody2D to that point with a speed of 10 (or whatever I want).
But, adding a distance onto the input direction doesn’t do anything. Only changing the speed in MoveTowards changes the distance that the game object moves. What am I misunderstanding about how these two functions work, or interact with each other?