Extending and retracting the pneumatics cylinders by pressing the same button

Hi, would anyone be able to help me solve the issue below?
How would i be able to use the same button for extending and retracting the pneumatics cylinders?

Hello Yuki,

You can do something like that by creating a Boolean variable to track if you have extended or retracted your cylinder.

Here is some block code demonstrating that technique:

4 Likes

thank you for your advice, it worked perfectly!