move player follow inclination of plane

I wanted to move my player so that follow the slope of the ground. I thought about using the raycast that depart from the player and hit the ground according to its normal. Otherwise I could use the sine and cosine to calculate the angle of the plane? Can you give me a tip?

2096278--137203--terrain.png

A raycast will give you the normal of the ground, you can then rotate your player to match (for example by setting its transform.up to match the normal).