Why each time pyramid gain speed?

I’m testing some basic interactivities on a simple scene.
I’m using coBlocks to create a button and rotate a pyramid indefinitely.
The button is a 2 state button.
When on pyramid turn. When off pyramid stop.
This method will be used on a lot of things in the future and I was surprised that if you click repetitively the button pyramid turns faster each time and sometimes return to the predicted speed. It seems the pyramid accumulates speed. I tried several tricks to avoid this issue.

This is the project.

Thanks for the support.


1 Like

Hi Luca,
Remix this code

I hope it helps. Good luck.

Thank you.
So I need to use global property instead a variable?



You can solve it with variables but in your case you’ve used the coblock “setvariable” inside the block “if” that means each time you initialize the value of the variable. You should use the “change” block instead.

To use change (by) you need to know the actual value of variable to have a final correct value, right? You cannot use “change” for a generic use of variables. It’s a bit confusing that the setproperty used in the same way it works.