Hi. So I am setting a specific block forexample stone to the players position on move and setting the old block to air. But the glitch I am getting is that even if the player is stationary, the block keeps moving back and forth. That is what can be seen but in reality a block is being set behind the player, then set to air and set in front of the player. and this keeps running continuously. The set block is meant to stay still as the player is still but it acts as if the player is moving up and down.. This is the code I am using. What could be causing this issue and how can I solve it?
The issue I'm getting by moving the setblock to behind the player however is that if the player wants to turn around and walk the other direction, the block comes in the way and doesn't let the player go past