Beyond Blender Render/Make Something Move

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Note on this chapter: The majority is taken up with descriptions of logic bricks. To fastforward to the work click Here

What's What?[edit | edit source]

Let me explain how each logic brick works.

Sensors[edit | edit source]

First there are sensors. These sense for something (such as keyboard presses or mouse clicks but not the neighbour's cat) and activate the controllers.

Actuator sensor[edit | edit source]

The actuator sensor detects if a particular actuator has been set off.

Always sensor[edit | edit source]

The always sensor basically means Always do this.

Collision sensor[edit | edit source]

Like touch but works with properties instead of materials.

Delay sensor[edit | edit source]

Delay sensor is activated after a set amount of time.

Joystick sensor[edit | edit source]

Senses joystick movements and presses

Keyboard sensor[edit | edit source]

This detects keyboard presses.

Message sensor[edit | edit source]

This detects messages sent by the message actuator.

Mouse sensor[edit | edit source]

Detects mouse input.

Near sensor[edit | edit source]

Detects if an object with a certain property is nearby.

Property sensor[edit | edit source]

Detects if a property on the current object is equal or between one or two equivalents.

Radar sensor[edit | edit source]

Detects an object with a certain property along a certain access.

Random sensor[edit | edit source]

Triggers so many times per second randomly.

Touch sensor[edit | edit source]

Detects when this object touches another object with a certain material.

Controllers[edit | edit source]

These decide what to do with the signal from the sensors (such as activate a python script or activate an actuator).

Actuators[edit | edit source]

These do something with the signal from the controllers (such as move, start a game or pause this one).

Add Some Logic[edit | edit source]

Okay, time to get to work. Make sure you are on the cube (or what ever you want your hero to be). Add four keyboard sensors. Next, add four and controllers. Finally add four movement actuators.

Now connect the top sensor with the top controller and the top controller with the top actuator. Then connect the second to the top to the second to the top and so on until they are all connected like so:

Next look at the top Keyboard Sensor. There should be a button with no text near the top. Click this button and then press the key you want to be Forward in the game. The most common keys for this purpose are "W" and "UpArrow". Then using the ones below you may set backwards, left and right.

Now your logic should look like this.

Now look down your actuator list. You'll see small fields with numbers in them. You can click them to edit their number. They control how much you are moving and in which direction. The fields go in the order of X axis, Y axis and Z axis. The fields with decimals in them are for motion and the fields with ° are for rotation (along the axis of your choice). Set all these to what you see in the above picture.

Note: If the L is on next to the fields that means that they will be Local directions for the object. If the L is not on they shall use global coordinates.

Next: Lights, CAMERA, Action: Learn how to use the camera