What do all the params for Tween.PunchScale mean? #160
-
Hi! There is Would love to know a bit more about those params! By trial and error I will eventually get an understanding of them, some documentation would be nice though |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey! Shake() and Punch() methods' parameters are documented in the public struct ShakeSettings {
[Tooltip("Strength is applied per-axis in local space coordinates.\n\n" +
"Shakes: the strongest strength component will be used as the main frequency axis. Shakes on secondary axes happen randomly instead of following the frequency.\n\n" +
"Punches: strength determines punch direction.\n\n" +
"Strength is measured in units (position/scale) or Euler angles (rotation).")]
public Vector3 strength;
public float duration;
[Tooltip("Number of shakes per second.")]
public float frequency;
[Tooltip("With enabled falloff shake starts at the highest strength and fades to the end.")]
public bool enableFalloff;
[Tooltip("Falloff ease is inverted to achieve the effect of shake 'fading' over time. Typically, eases go from 0 to 1, but falloff ease goes from 1 to 0.\n\n" +
"Default is Ease.Linear.\n\n" +
"Set to " + nameof(Ease) + "." + nameof(Ease.Custom) + " to have manual control over shake's 'strength' over time.")]
public Ease falloffEase;
[Tooltip("Shake's 'strength' over time.")]
[CanBeNull] public AnimationCurve strengthOverTime;
[Tooltip("Represents how asymmetrical the shake is.\n\n" +
"'0' means the shake is symmetrical around the initial value.\n\n" +
"'1' means the shake is asymmetrical and will happen between the initial position and the value of the '" + nameof(strength) + "' vector.\n\n" +
"When used with punches, can be treated as the resistance to 'recoil': '0' is full recoil, '1' is no recoil.")]
[Range(0f, 1f)] public float asymmetry;
/// <see cref="PrimeTweenManager.defaultShakeEase"/>
[Tooltip("Ease between adjacent shake points.\n\n" +
"Default is Ease.OutQuad.")]
public Ease easeBetweenShakes;
And by the way, PrimeTween comes with full source code available. To index the source code in your IDE, just enable this setting:
|
Beta Was this translation helpful? Give feedback.
Hey! Shake() and Punch() methods' parameters are documented in the
ShakeSettings
struct: