The touch-move rule in chess specifies that, if a player deliberately touches a piece on the board when it is his turn to move, then he must move or capture that piece if it is legal to do so. If it is the player's piece that was touched, it must be moved if he has a legal move. If the opponent's piece was touched, it must be captured if it can be captured with a legal move. This is a rule of chess that is enforced in all games played in formal over-the-board competitions. The player claiming a touch-move violation must do so before making a move.

Is it true that do you have to move a piece if you touch it in chess?
yes