I am making an attempt to implement a splash capability for my participant that feels good, however what I’ve proper now form of feels “flat.” What I’ve is fairly easy, like this:
utilizing UnityEngine;
utilizing System.Collections;
public class Instance : MonoBehaviour
{
[SerializeField]
personal float dashLength = 5;
[SerializeField]
personal float dashDuration = 0.2f;
personal IEnumerator DashCoroutine()
{
// I'm deriving this from one of many kinematic equations (0 acceleration)
float dashForce = dashLength / dashDuration;
float elapsedTime = 0;
whereas (elapsedTime < dashDuration)
{
elapsedTime += Time.deltaTime;
rework.Translate(rework.proper * dashForce * Time.deltaTime);
yield return null;
}
}
}
I’ve seen others counsel including one thing like a slight digital camera shake, however my query is extra about methods for manipulating the horizontal velocity in order that it does not simply really feel like my participant is rigidly rushing up after which returning to regular motion. Nonetheless, I’m open to all recommendations.