Пример #1
0
    public void FixedUpdate()
    {
        if (_isManipulating)
        {
            var target    = RaycastController.GetPosInCenterOfView(_distance);
            var grabPoint = transform.TransformPoint(_grabLocalPos);

            Rigidbody.AddForceAtPosition((target - grabPoint) * ForceMultiplier, grabPoint);
            Rigidbody.AddForceAtPosition(-Rigidbody.GetPointVelocity(grabPoint) * DampingMultiplier, grabPoint);
        }
    }