Exercise 4b: show and hide
Subjects covered:
- Shortcuts
- Object Visibility
- Target
You will need:
BBs:
BB Show and Hide in Visuals\Show-Hide folder.
Creating Behavior
- Display the elapsed time output of the Chrono BB using a shortcut to its parameter output Elapsed Time and displaying the shortcut value by right-clicking the shortcut and selecting Change Parameter Display and selecting Display Name and Value.
- Add the Show and Hide BB to the script.
- If the Script is on the Level, add Target parameter to Hide and Show BBs to specify the object to hide/show. To do this, you right click on the Hide BB, select Add Target Parameter, then right-click for Edit Parameters, and for the Target (Behavior Object) in the pop-up Edit Parameter menu, select your cube. You’ll notice a new paramter has been added to the top of the BB. Repeat for the Show BB.
- Link the Exit On output of the Chrono BB to the input of the Show BB; it will show the cube when the Chrono BB is activated.
- Link the Exit Off output of the Chrono BB to the input of the Hide BB; it will hide the cube when the Chrono BB is deactivated.
Exercise 4b Solution (file is a .cmo file)