I’m trying to give a Game object with a rigid body a ‘goal’ location that it will stick to. Other physics objects should be able to push it away from that point but it should always ‘spring’ back.
void Update ()
{
direction = goal - transform.position;
speedMod = Mathf.Lerp(0, speedEffectLimit, direction.magnitude) * speed;
rigidbody.AddForce(direction.normalized * speed, ForceMode.Force);
}
But I can’t get the objects to stop overshooting their goal. Is their any other way to achieve this?