- Home /
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!
Answer by Downstream · May 12, 2014 at 05:07 PM
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
Answer by MainframePT · May 12, 2014 at 08:01 PM
I'm doing just that, my issue is with restraining the min and max angles related to the elevation of the bridge.
Your answer
Follow this Question
Related Questions
Circular Joints? 0 Answers
Mathf.LerpAngle working once, but not again 1 Answer
Making a Button in unity? 2 Answers
How to use AndroidJavaClass.Call() to pass a data object 1 Answer
Smooth Camera Angle Scroll 1 Answer