If else expression

HI.i want to reach this feature like if(x==0)x++;if(x>10)x=0;
I know the switch can get the expression of if(x>10)x=0 but how to get expression if(x==0)x++ .
My goal is moving a ball for step of 1 unit.if the ball get the point x==10,the ball will go back to original point x=0 and repeat the cycle previous.

Look like this gif show.but i don’t know how to do this in synfig.

if(@Frame%24==0)@P.y+=1;
if(@P.y>5)@P.y=0;

How about using constant type waypoints with a time loop?
digitalMotion.sifz (1.9 KB)

1 Like

Thanks for your sharing.it is a efficient method to get this kind of effect.
I just wonder how to get this effect automaticly.

You can do the animation automatically but there isn’t any advantage, but will only increase in complexity. You can also do cool stuff if you use math and exporters properly

But for your example it’s best what @GregorysonofCarl has suggested, to use time loop layer.

You can achieve something with converter Linear, which will increase periodically in linear way. Try changing the values and you will figure it out.

If you have to repeat some action you have to use Time Loop layer/converter doing this on your own is not useful at all.

There is also the step convert type which also creates stepped motion.

Thanks for inro.i will take a try.

I will take a look at that. thanks again.