Module 1 Project 2: Traffic Light

All cars require some way to keep roads safe, that is where these lights come in!

We will be utilizing the following topics:

  • Parts
  • Material
  • BrickColor
  • Anchoring
  • Scripting

Making the Traffic Light

The Essentials

  1. Get 1 part and 3 spheres (red in image).
  2. Add BrickColor and Material (blue in image). To make the lights glow, choose the Neon material.

  3. Make the traffic light.
  4. Place them in a similar fashion as shown below.

image

Anchoring and Naming

  1. Select all the parts and on the
    Home
    or
    Model
    tab's (the picture below shows
    Home
    ), click on
    Anchor
    (red in image).

  2. Select all pieces at the same time and press Ctrl+G on Windows, or Cmd+G on a Mac to group them.

  3. Go ahead and name every part, organization is important. Also, it will get students into a good habit! It is suggested to name them: "Base", "BotLight", "MidLight", and "TopLight", respectively.

image

The Script

  1. We will be keeping track of the three lights and repeatedly flash them one by one.
  2. Add a script inside the
    Group
    and add the following code:

Note: If you didn't name your parts TopLight, MidLight, and BotLight, rename the respective lines in the code to the correct names (they can't all be

Part
!).

If you want to customize your traffic light colors, open the Color button and hover over the color you want to see the name.