-
Expression to pick one of six values based on slider
Hey everyone, this feels like it should be a simple one, and it’s definitely something I’ve achieved before but I’ve sort of tangled myself up and can’t quite see where to go.
I have a slider that is outputting a value between 1 and 6 based on a wiggle:
w = wiggle(6,4);
Math.max(1,Math.min(6,w)).toFixed(0)I have 6 nulls in 3D space.
I then have my effect which I want to wiggle between these nulls based on the slider’s “dice roll”. So far I have defined my variables, but I can’t think how to format the expression in order to achieve this.
This is how far I’ve gotten:
dice = effect(“Zap Roll”)(“Slider”);
t1 = thisComp.layer(“Edge Zap Target 1”).transform.position;
t2 = thisComp.layer(“Edge Zap Target 2”).transform.position;
t3 = thisComp.layer(“Edge Zap Target 3”).transform.position;
t4 = thisComp.layer(“Edge Zap Target 4”).transform.position;
t5 = thisComp.layer(“Pylon 1 – Top”).transform.position;
t6 = thisComp.layer(“Pylon 1 – Bot”).transform.position;if (dice=1) t1
So if dice=2, the effect value should be t2, etc.
Any help would be greatly appreciated.
• Archie •