Hi! here, there are two arm which rotate at 360°, and ther’s a ‘Carpet’ that should be straight during this rotation. how can I do for keep the carpet straight, but into the arms? Thank you:smile:
This is the problem:
This is how it should work
If can help you, the script: ```csharp
**If can help you, the script:
public class RotazionePedana : MonoBehaviour
{
public GameObject teller;
float teller_rot;
float speed = 10f;
public float maxSpeed = 10f; //modificare la velocità nell’editor non qui.
public float reverseSpeed = -10f; //modificare la velocità nell’editor non qui.
void Awake()
{
teller_rot = 0.0f;
speed = 0.0f;
}
void Update()
{
if (Input.GetKey(KeyCode.Q))
{
speed += 1;
}
if (Input.GetKey (KeyCode.E))
{
speed -= 1;
}
else if (Input.GetKey (KeyCode.W))
{
speed = speed * 0.9f; //Freni
}
if (speed > maxSpeed) speed = maxSpeed;
else if (speed < reverseSpeed) speed = reverseSpeed;
teller_rot = teller_rot + Time.deltaTime * speed;
teller.transform.localEulerAngles = new Vector3(0.0f, 0.0f,teller_rot);
}
}** ```
The question is, when the arms rotate, the carpet should be rotate, but as in the second picture that i’ve posted, instead it rotate wrong (look the firts pic). It should be rotate straight as in the second picture. Hope i’ve explained.