I'm trying to achieve an effect where a little object will turn around another object (in false 3D). To do this I put an horizontal sine, a slight vertical sine (same period), and Im trying to change the moving object's layer based on the value of the horizontal sine. Here is what my code looks like :
for an amplitude of 100
object.sine.value <-99 set object to layer 0
object.sine.value >99 set object to layer 2
Of course my other object is on layer 1, so the first one should "turn" around it.
It seems pretty straightforward but the result is not convincing at all. Actually the moving object often passes 2 times before the other one, sometimes it switches layer in the middle of the movement.
I also tried to change the layer based on X value of the moving object, but the result is not better.
Am I missing something with the way sine's value works?
Thanks in advance!