I’m using the following code for rotate my surface controls:
using UnityEngine;
using System.Collections;
public class pivotTest : MonoBehaviour {
Transform C_elevator;
// Use this for initialization
void Start ()
{
C_elevator = transform.FindChild("C_elevator");
}
void Update ()
{
float vertical = Input.GetAxis("Vertical") * Time.deltaTime * 10;
C_elevator.RotateAround(C_elevator.position, C_elevator.right, vertical);
}
}
The problem is while I’m not changing my axis, surfaces should return to the idle position. I assume I should change my object’s rotation…
Can you help me, please?