Пример #1
0
    public override void _PhysicsProcess(float delta)
    {
        if (_picked)
        {
            var axis = (_touchPos - GlobalPosition + _offset.Rotated(GlobalRotation)).Normalized();

            LinearVelocity += axis * _acceleration * delta;

            if (LinearVelocity.Length() > _VelocityLimit)
            {
                LinearVelocity = LinearVelocity.Clamped(_VelocityLimit);
            }
        }
    }