Play and Pause Button

I’m doing a Play and Pause button. In the beginning, the “Pause” button is hidden and the button “Play” is visible.
I want that when you press the Play button the Play button is hidden and becomes visible the Pause button and that when you press the Pause button, the Pause button is hidden and becomes visible the Play button.

The problem is that when i add the events in that order, when you press the play button and remains the same. Because it makes the transition to the last action, which is to turn the pause button in play, then the play button goes to the play button and the pause button is omitted .

How I can make this work well?

The simpliest might be to separate the position of the two button : what happen is that when you click the button is making a loop i guess.

Use two separate position to start, to be sure your button are functionning, then you’ll have to use variable to avoid the button “to loop”.