MMotion.Punch
Create a punch around a starting value, with a float, Vector2 or Vector3 strength.
public static class PunchVibrationMotion.cs · L38Return to the starting value
Add using MeatMotion;. The second argument is the strength. This punch returns to its starting value of 3 at the end of its one-second duration.
float value = 0f;
using var world = new MotionWorld();
var punch = MMotion.Punch.Create(3f, 2f, 1f)
.WithFrequency(5).WithDampingRatio(1f)
.WithScheduler(world).Bind(v => value = v);
punch.Complete();
Members
Create
Create a punch around a starting value, with a float, Vector2 or Vector3 strength.
public static MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter> Create(float startValue, float strength, float duration)Parameters and return value
startValuefloatStarting value.strengthfloatOscillation strength relative to the starting value.durationfloatDuration in seconds.- Returns
MotionBuilder<float, PunchOptions, FloatPunchMotionAdapter>
public static MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter> Create(Vector2 startValue, Vector2 strength, float duration)Parameters and return value
startValueVector2Starting value.strengthVector2Oscillation strength relative to the starting value.durationfloatDuration in seconds.- Returns
MotionBuilder<Vector2, PunchOptions, Vector2PunchMotionAdapter>
public static MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter> Create(Vector3 startValue, Vector3 strength, float duration)Parameters and return value
startValueVector3Starting value.strengthVector3Oscillation strength relative to the starting value.durationfloatDuration in seconds.- Returns
MotionBuilder<Vector3, PunchOptions, Vector3PunchMotionAdapter>
MeatMotion