How to align first person "plank" object to slopes?

Hi,
I’m working on a game where there is a plank object under the first person camera (like a snowboard/skateboard) and I’d like for the plank to align to different slopes that come under the first person controller. Could anyone help me with this or point me in the right direction?

lookatpoint = board.transform.position + board.transform.forward * board.collider.bounds.extents.z;

ray Castray;

Castray.origin = lookatpoint * vector3.up * 10f;
Castray.direction = vector3.down;

Raycasthit Hitinfo;

physics.raycast(Castray, out Hitinfo);

board.transform.lookat(Hitinfo.point, Hitinfo.normal);

so lets now break down what this does

lookatpoint = board.transform.position + (board.transform.forward * (board.collider.bounds.extents.z + .01f);

this gets the point 1/10th of a meter from the tip of the board. this may be a point in the air or underground initially it doesnt matter we just want a point near the tip of the board.

   Castray.origin = lookatpoint * vector3.up * 10f;
    Castray.direction = vector3.down;
    physics.raycast(Castray, out Hitinfo);

this goes 10 meters above the point in front of the board and casts a ray down to find the ground
at that point

board.transform.lookat(Hitinfo.point, Hitinfo.normal);

finally were going to have our board tip looking directly at the ground in front of it so its aligned with the ground and to make sure the X axis is aligned with it as well were going to tell it which direction is up.

Up is going to be whatever direction is up from the ground so if the ground is steeply inclined and up angles back then the boards up will angle back too.

You need a solid understanding of what normals are for this to make sense and probably how rotations work so i’d google normals and ask questions if you need further understanding.