void Update()
{
float movementAmount = speed * Time.deltaTime;
float movementInput = playerControls.Player.Move.ReadValue();
transform.position = Vector3.MoveTowards(transform.position, movePoint.position, movementAmount);
if (movementInput < 0)
{
Move(new Vector3(-1f, 0f, 0));
}
else if (movementInput > 0)
{
Move(new Vector3(1f, 0f, 0));
}
}
I have this as my code but I want the movementInput to only be read once. Right now I added A and D to a positive/negative binding Action in the InputSystem and when I press A the Object just moves left to infinity. How do I make it so my Move function is only outputted once? Or is a better way of asking how to make it so my Action is only read once.