Where is object looking


I need help , How can i determine which direction is Main Character looking ?

I need to do smt like if main character is looking on the gameobject (its in front of him)

make something how to do this ?
and how to set the angle that will be taken as mainchar is looking forward

you can use Vector3.forward for that. to get the forward direction of the main camera, you can use Camera.main.Vector3.forward to obtain its forward rotation value.

thanks but can you write back and example ?
i still cant imagine how can i use this … if i have an gameobject and i want to make my character jump when he is in front of GameObj. how i write the if statement ? If( vector3.forward … ? unity script reference dont help me too …

sry for my english