Like sgt Frag ansered, use a door. Func_door_rotating.
Here is a nice tutorial tu build a door. Apply it to the cog you want to use (
link)
I will give you some extra advices about the entity:
1) Set "Delay Before Reset" to -1, so your door will not close after opening
2) If you want to rotate it multiple times, do the following:
- Set the "Rotation Distance" in a high number, for example 3600000
- When you want to rotate the cog, issue a "open" input.
- Before making it stop, set the speed with "SetSpeed" to 0. The speed will not be updated until the door changes what it was doing (now it's opening, the speed will change when it closes or when it's fully open)
- Order the door to close. The door will immediately stop, because it's speed is 0.
- After that, change the speed back to the value you had before changing it
Aplied to a relay, it would end:
Code:
OnTrigger -> my_door -> Open (delay: 0.00)
OnTrigger -> my_door -> SetSpeed -> 0 (delay: 0.50)
OnTrigger -> my_door -> Close (delay: 4.00)
OnTrigger -> my_door -> SetSpeed -> 100 (delay: 4.01)
With this, the door will rotate for 4 seconds before stoping. Take in mind that you will need to wait 0.01 seconds before opening it again