Graphics Programs Reference
In-Depth Information
F
Sensor 3:
Type: Mouse
Name: mousemove
Mouse Event: Movement
14. Then go to the second column, add a controller of type
Python Script
, and set its
name as
look
.
15. The last thing needed to complete the logic bricks setup is to connect the three
sensors of the
mainControl
object to the
look
controller and then connect the
output of the
look
controller to the
baseMover
and
viewRot
actuators of the
base and derived objects, respecively. Noice that it is possible to connect logic
bricks between different objects if we select them in the 3D View, which is very
useful.
16. The
mainControl
object must also have a couple of properies, so let's add two
properies to it. The irst must be named
hold
, its type set to
Boolean
, and the
toggle buton let unpressed (meaning
False
). The second property must be named
pointerSpeed
, its type set to
Float
, and its value set to
0.01
. The
hold
property
will be used to know if the user has the mouse buton clicked when the pointer
moves (which means the user wants to look around) and the
pointerSpeed
is just
used to control how sensiive the camera must be to mouse movements.
To wrap it up, let's take a look at the next three screenshots, detailing how the final setup
must look: