Raise/Low Bridge

Greetings,

I’m currently developing a game and have a bridge that will raise or low depending on an external trigger. The trigger itself is done but the simple movement of the bridge has been causing some problems: the bridge is a cube that rotates around another gameobject located at one of its edges. The bridge has to slowly raise and low between 0º and 90º angle on the X axis.

I’ve been trying to use functions like Mathf.LerpAngle() based on Unity documentation but with no success. Any help would be greatly appreciated!

Use transform.RotateAround? You get the position from the object you’re rotating around and the axis from one of its facings (i.e. transform.forward).

http://docs.unity3d.com/Documentation/ScriptReference/Transform.RotateAround.html

I’m doing just that, my issue is with restraining the min and max angles related to the elevation of the bridge.