velocity direction and reversing it

hey guys, i’m in the middle of making a snowboarding game where I want the velocity of the snowboard to be in the direction it is facing. The way I’m trying to do this is by saying “if the velocity direction is not the snowboard direction, then add a force in the opposite direction of the velocity to counter it”. This is what I have so far(but it’s not working):

if(rigidbody.velocity.normalized != transform.eulerAngles){
var velocityDirection = transform.InverseTransformDirection(rigidbody.velocity.normalized.x, rigidbody.velocity.normalized.y, rigidbody.velocity.normalized.z);
rigidbody.AddForce(velocityDirection * rigidbody.velocity.magnitude);}

I would appreciate it if you guys could help me out with this one. Thanks!

How about:

  void FixedUpdate()
        rigidbody.velocity = transform.forward * rigidbody.velocity.magnitude;