Open cyu72 opened 1 year ago
Everytime you press an arrow key, it adds another input on top of your next input. Eg. Click left arrow 1, it counts once, click it again, it counts twice despite one click.
The issue may lie in how many useEffects I have, but still not sure why adding setGunTipY sets it overboard.
The ship starts gliding after multiple inputs when I add props.setGunTipY in a useEffect hook. Possibility that its affecting the original setNextPosX value?