Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| brasil:courses:blender_unity:unity:4_moving_objects [2026/08/25 19:15] – [Attaching a C# Script to a GameObject] yann | brasil:courses:blender_unity:unity:4_moving_objects [2026/08/25 19:29] (Version actuelle) – [Exercise] yann | ||
|---|---|---|---|
| Ligne 146: | Ligne 146: | ||
| using UnityEngine; | using UnityEngine; | ||
| - | public class EarthRotation | + | public class earthRotate |
| { | { | ||
| public Vector3 localRotationSpeed; | public Vector3 localRotationSpeed; | ||
| - | // Start is called before the first frame update | + | // Start is called |
| - | | + | void Start() |
| { | { | ||
| + | | ||
| } | } | ||
| // Update is called once per frame | // Update is called once per frame | ||
| - | | + | void Update() |
| { | { | ||
| this.transform.Rotate(localRotationSpeed * Time.deltaTime, | this.transform.Rotate(localRotationSpeed * Time.deltaTime, | ||
| Ligne 168: | Ligne 168: | ||
| Set the Y-axis to 50. | Set the Y-axis to 50. | ||
| - | {{: | + | {{ : |
| This variable is of type Vector3, meaning it’s a 3-dimensional vector that can store a value for the X axis, a value for the Y axis, and a value for the Z axis. | This variable is of type Vector3, meaning it’s a 3-dimensional vector that can store a value for the X axis, a value for the Y axis, and a value for the Z axis. | ||
| Ligne 177: | Ligne 177: | ||
| In the editor, you can see in real time that your script is changing the GameObject’s rotation along the Y-axis. | In the editor, you can see in real time that your script is changing the GameObject’s rotation along the Y-axis. | ||
| - | {{: | + | {{ : |
| ===== Conclusion ===== | ===== Conclusion ===== | ||
| Ligne 185: | Ligne 185: | ||
| ===== Exercise ===== | ===== Exercise ===== | ||
| - | - Add a Milky Way skybox; to do this, use the Asset Store (Milky Way Skybox) | + | - Add a Milky Way skybox; to do this, use the Asset Store (Milky Way Skybox) |
| - Make the moon rotate on its axis | - Make the moon rotate on its axis | ||
| - Make the moon orbit the Earth | - Make the moon orbit the Earth | ||
