- Home /
left/right rotation force
Hi to all, I've created a script that makes a half a turn on right and left if i press a key. How can I do for give force with 2 keys? Movement is similiar to swing.. if I relase keys, the position return to original position.. would that it were: Press taste1 = left rotation; Press taste2 = right rotation
void Update() { //-- arm rotation float arm_rot = Mathf.Sin(gondelarm_sin) 80.0f; gondelarm_sin = (gondelarm_sin + Time.deltaTime 1.0f) % 360.0f;
gondelarm.transform.localEulerAngles =
new Vector3(0.0f, 0.0f, arm_rot); }
Your answer
![](https://koobas.hobune.stream/wayback/20220613105146im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do i make it more horizontally with no rotation? 1 Answer
Using Accelerometer to move and rotate a 3d cube from left to right 0 Answers
Sprite tilts left/right depending on how far it is from the center [C#] 1 Answer
moving like a snake to the right and to the left 1 Answer
endless runner game help 2 Answers