Notifications
Clear all

[Closed] Help needed with controller expressions/script

I have a custom slider (Slider01) control set up to a series of objects (the reloading of a gun). As the slider progresses, the components/mechanism of the gun are animated and the bullet position is returned back to its starting position; as it was before the animation started, thus allowing it to properly loop (the bullets fired from the muzzle will be taken care of by pflow).All of this is done using the Reaction Manager.
This works perfectly when i set the keyframes and Loop using Param. Curve Out-Of-Range, but it does not give me proper control over ending the loop.

 So i created another slider (Slider02) and wrote an expression on the percent attribute of Slider01.
if (ConLoop>.5, F/50, 0)
     Conloop= percentage of Slider02
 Now the new slider(Slider02) acts as a loop switch, so when the value of Slider02 is over 50%, it enables Slider01 and lets it run.
 The problem i am running into now is that because Slider01 controls animations through Reaction Manager, it's last state ended at 90% of its value in the Reaction Manager. So while the expression works, the animation wont loop because Slider01's value goes beyond 100%. So i need to force Slider01 to return back to 0% when it reaches 100%. 
 Here is where my problem comes in. I cannot find any way to self-reference Slider01 using Controller Expression. 
If Slider01percent>.9, Slider01percent=0

or something similar should work to force it back to 0% but I cannot get past Circular Dependency Errors.

 I want my end result to be: when a slider is past 50%, the gun shoots a bullet, reloads, and repeats until i change the sliders value back to 0%.
 Anyone on how to work past this or any ideas of other ways to do what i am trying? I appreciate your help.
1 Reply

Problem Solved