constrain a real attribute with MIN and MAX
MattButlerStudios
Member Posts: 486
I have a real attribute that is my time. I need it to only go from 1 to 3.30 seconds. How can I do this? When it hits zero it resets to 10 even though the attribute value is set at 5.
Comments
If you want to keep an attributes value between a min and max use Constrain Attribute like this, myTime to min(max(myTime,0),210).
The min(x,y) function has two parameters and it will always choose the smallest value so in this case myTime cannot go above 210. The max() function stops it from going below 0 by returning the maximum value between myTime and 0.
The Constrain Attribute behaviour can be placed in your actor on its own i.e. not in a rule and it will monitor myTime keeping it in the min/max range. Use a rule to reset myTime to 10 if it equals 0.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@colander thanks a lot. I was having trouble figuring out the correct code format!
www.mbstudios.co | Free Stuff