Can anyone explain this code for me please?

Hey! Hope your day is great! So i’m pretty new to c# and the whole unity thing so i can’t seem to understand this.

I have this line of code that brings the number from 0.6 to 0.65 when you press down and when you let go you go back down to 0.6.

    public float size;
    float velocity;

size = Mathf.SmoothDampAngle( size, (Input.GetMouseButton(0)) ? .65f : .6f, ref velocity, .05f);

The problem is i don’t get how the whole

(Input.GetMouseButton(0)) ? .65f : .6f

Works or even why i need the “ref velocity” there.

Id also like to know if i can do the same thing above but like

        if (Input.GetMouseButtonDown(0))
        {
            size = Mathf.SmoothDampAngle(size, (Input.GetMouseButton(0)) ? .65f : .6f, ref velocity, .05f);
        }

I don’t even know. Thanks for the help!

I figured it out.