Objective: To manipulate as many sensors as possible to as part of the learning process, with a focus on the near sensor, the and controller, and the visibility actuator.
Materials: Logic Editor, Sensors Iâm using âand, keyboard, visible object.â
Method: Our first task was to create a scene that had 3 cubes and used some of the sensors.
While doing this I like using texture mode to see the lightâs impact on the world. Made each cube a different color and gave them individual names.
One cube (green) was made static, another (yellow) hovered above it and was rigid, and a third red cube (which was just hanging around) was also hovering and static
First I used the near sensor on my yellow cube and I made sure to name my sensor so I wouldnât get confused later. For the âmonkeyâ version there were two of them. It is important to make sure the distances set in the sensor are viable with your scene. The next step was to add a controller. This is linked to the sensor with a symbolic little wire connector. I then added two visibility actuators. The first one makes the yellow cube disappear and the second made it reappear. This is done by inverting everything and leaving visibility checked.
As far as the green cube goes – donât forget to make it an actor!
For the red cube, we brought it over very close to the âfallingâ cube. However this did not cause the falling cube to disappear any sooner. The fix for this was to expand the distance property the yellow cubeâs sensor.
(It is important to note that the physics of the falling cube are still being executed even when it is invisible)
Then to clean up the logic editor I took the falling cube, eliminated one sensor and added a nor controller â this is an example of how the logic of more complicated scenarios are developed.
Lastly I switched the near sensor to Keyboard and designating the space bar. This makes it fun because then you can make the falling cube visible and invisible at will.
Result: A scene with 3 cubes. One of the cubes disappeared and reappeared based on its proximity to the others.