Sign in
Home
Online Classes
Instructors
Tutorials
☰
Register
Sign in
Online Classes
Instructors
Tutorials
1. Angles and Axes (c)
2. Set Up Your Project
3. Add a Script to SpinningBlock
4. Write Script to Make Your Block Spin
5. Save and Test
6. Make a Pinwheel
7. Make a Block Rotate in a Different Direction
8. Consolidate Your Code (Optional)
Project 563: Spinning Blocks
7. Make a Block Rotate in a Different Direction
In a new block, change the code so that the block rotates in a different direction from your original, which rotates on the Y axis.
Starting point file for this challenge
Your goal
Hint: show steps
Steps
1. Duplicate a SpinningBlock
Hint: show details
Duplicate an existing SpinningBlock by right clicking on it and selecting 'Duplicate'.
Hint: show image
2. Copy the orientation of the new block
Hint: show details
Copy the
Y orientation
of your new block is, so you can use it in your code later.
Hint: show image
3. Open the script of your new block
Hint: show details
Find your new SpinningBlock in the Explorer, then click the arrow next to it to show the files inside. Double click on 'SpinScript' to open it.
Hint: show image
4. Replace the rotate variable with the Y orientation
Hint: show details
Inside the Vector3, replace the 'rotation' variable with the Y orientation you copied in step 2.
Hint: show image
5. Put the rotation variable back in
Hint: show details
Now, replace the zero in either the X or Z positions in the Vector3 with the rotation variable.
Hint: show image
6. Make sure the rotation variable starts at 0
Hint: show details
Depending on which block you duplicated, your rotation variable may be set to a different number at the beginning of your code. You will probably want to make it 0 to avoid confusion later.
Hint: show image
7. Save and Test
Hint: show details
Save your project and hit the play button to test it out! Does it spin in the direction you wanted?
Hint: show image
×
×
Provide your email address for immediate project access
Email
Check your email for instructions on how to create a full DA account