Dive.OnCollisionEnter C# (CSharp) Method

OnCollisionEnter() public method

When the player collieds with the ball, decrease the speed of the ball.
public OnCollisionEnter ( Collision col ) : void
col Collision
return void
    void OnCollisionEnter(Collision col)
    {
        if (isServer)
        {
            if (col.gameObject.tag == "Ball" && !isUpright)
            {
                Rigidbody RB = col.gameObject.GetComponent<Rigidbody>();
                RB.velocity = ballSlowdown * RB.velocity;
                RB.angularVelocity = ballSlowdown * RB.angularVelocity;
            }
        }
    }
}