I was trying to understand how to script animations when I saw these properties and functions of AnimationTrack: WeightTarget, WeightCurrent and AdjustWeight. I looked at the code samples but couldn’t understand anything. What are these properties used for?
To give a better explanation: Weights are essentially percentages on when the animation will play so for example [The higher the more likely it is to play.]: Swish 1 has a 35% chance of playing and Swish 2 has a chance of 65% of playing.
That’s an explanation for animation weights, here is what you asked for:
- Weight Target
When you set the second argument of AnimationTrack:Play(.2, 1, .1) -- 1 is our Weight Target
, it doesn’t change immediately but the time it takes to complete or change to that weight is by your first argument the fade time. This is probably only useful when comparing it to WeightCurrent
. It’s also your desired weight.
- Weight Current
This is essentially just the current weight of the animation. The only other use of it, is again, comparing it to WeightTarget
just to see if your desired weight has been achieved.
- Adjust Weight
Nothing special here, it’s just meant to change weights.
If you put 0 in the fadeTime argument then it will instantly just move to your desired weight.
If you need anything else, just ask!
So are these properties a way to set how often or when an animation plays?
they are readonly but I think you get what I meant
Yes, when you use AdjustWeight or by putting arguments in YOUR_ANIMATION_TRACK:Play(arg1, arg2, arg3)
.