Copy link to clipboard
Copied
I want to make a score counter for two teams. I have a counter (slider) for the first command and for the second, they are in the same layer (number 1). In other layers, I do some mathematical actions as a result of which I need to increase the value of one of the sliders. Each subsequent layer should do the same. Probably there should be a function that will increase the value of one of the slider, and it can be called from any layer and it will increase the value of the slider.
const scaleController= thisComp.layer("scoreleft").effect("scoreleft")("Slider");
$.newScale = 59;
scaleController, 0, 100, [$.newScale+1];
Copy link to clipboard
Copied
Why do you even declare a constant, within expressions code of all things? That makes no sense whatsoever. You also have not explained sufficiently how your setup is actually structured. Generally, though, it seems to me you are misunderstanding how expressions work in that a) evaluation is strictly downstream and b) all properties have to be explicitly linked. So whatever you have in mind would likely simply boil down to adding a +1 and pickwhipping your counter slider. At any rate, you have to offer a better explanation and more info.
Mylenium
Copy link to clipboard
Copied
Are you talking about writing a script or expressions?
Expressions can only change the value of the property to which they are applied. There is nothing like an expression on a property that changes the value of a slider (except if the expression is applied to the slider itself).
Copy link to clipboard
Copied
I do not know what you are trying to do, but here's something that might help. You can use the pick whip to easily link a value to another, even those in different comps.
After that, you can easily do your math thingy. Hope this helps!