I have a player object who can rotate(face using mouse) up, down left right and can face straight. I am willing to know that how to determine that where is camera facing? Either it is looking up or down?? while the player is continuously moving in a up/down surface.
Use dot products.
Assuming left, down, up, and right are global directions you dot the Camera fwd with each vector respectively (You actually only need to do two calculation because of how dot products work).
It would look something like this
//Will return between 1 and -1. 1 means left, -1 means right float leftRight = Vector3.Dot(camFwd,Vector3.left); //Will return between 1 and -1. 1 means up, -1 means down, float upDown = Vector3.Dot(camFwd,Vector3.up);
Do whatever conditional checks you need to determine direction priority.
Have the game check the camera's rotation. If the camera's x rotation is around 90 degrees they are facing up. if the camera's x rotation is around -90 degrees they are facing down. if the camera's rotation x rotation is around 0 they are facing forward and if it is around 180 they are facing backwards. Then have the camera spawn a ray that is equal to the rotation of the camera and use mathf.aproxemetly to see which rotation is closest.