-AUTEUR(S): plissken
-DESCRIPTION : rotation automatique d'un soleil en nuit
-UTILISATION : Placer le script le directional light
-SCRIPT :
Code : Tout sélectionner
function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.
transform.Rotate(Vector3.right * Time.deltaTime);
// ... at the same time as spinning relative to the global
// Y axis at the same speed.
transform.Rotate(Vector3.up * Time.deltaTime, Space.World);
}
Code : Tout sélectionner
function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.
transform.Rotate(Time.deltaTime, 0, 0);
// ... at the same time as spinning it relative to the global
// Y axis at the same speed.
transform.Rotate(0, Time.deltaTime, 0, Space.World);
}