I'm trying to change the ConstantForce of a gameobject upon collision with a tagged object:
public class MyScript() { public ConstantForce fakeGravity; private void Awake() { fakeGravity = GetComponent<ConstantForce>(); } private void OnTriggerEnter(Collider other) { if (other.CompareTag("IncreaseGravity")) { fakeGravity.force = new Vector3(0.0f, 5.0f, 0.0f); } } } This causes a sudden change in the ConstantForce, but what I would really like is to apply this force gradually from 0 to 5, so that it feels more natural. How could this be achieved?