How to get the players forward speed?

I’m making currently making a 3D fast pace platformer game, and I was wanting to add a speed effect to the game. The idea was that when the player reaches a certain speed, the effect would appear.
My problem is that I don’t how to make it so when the player’s forward speed is greater than a number, the effect appears. I tried using Rigidbody.velocity but that doesn’t have the option to get the player’s forward velocity.
Thanks in advance

Rigidbody.velocity.x on X


Rigidbody.velocity.magnitude on XYZ (but it is using a squareroot, so it is not a fast math compared to multiplication) maybe fine but use


Rigidbody.velocity.sqrMagnitude which is speedxspeed so you can perform : if (Rigidbody.velocity.sqrMagnitude > maxspeed*maxspeed) …