Rotation of game object with some speed in clockwise and anti-clockwise on the basis of the player movement

I want the tangent logic used for rotation of the gameobject in particular axis for example 90 to -90 and then rotate back to 90 and it keeps patrolling like watch tower because quaternion.eulerangle is not working for me

You can make an animation. Make an animation and if you want to detect something in the watchtower’s range you can create a collider. With what you are doing it doesn’t seem like it will need many keyframes.