Game Creation Kit: Last modified 02/02/07 17:04:05 cw
Prev | Chapter 26. Blenders game engine | Next

# 26.5. Properties

Properties carry information bound to the object, similarly to a local variable in programming languages. No other object can normally access these properties, but it is possible to copy Properties with the Property Copy Actuator (see Section 27.3.7) or send them to other objects using messages (see Section 27.3.11).

Figure 26-6. Defining properties

The big "ADD property" button adds a new Property. By default a Property of the float type is added. Delete a Property with its "Del" button. The MenuButton defines the type of the Property. Click and hold it with the left mouse button and choose from the pop up menu. The "Name:" text field can be edited by clicking it with the left mouse button. SHIFT-BACKSPACE clears the name.

| Property names are case sensitive. So "Erwin" is not equal to "erwin".

The next field is different for each of the Property types. For the Boolean type there are two radio-buttons; choose between "True" and "False". The string-type accepts a string; enter a string by clicking in the field with the left mouse. The other types use a NumberButton to define the default value. Use SHIFT-LMB for editing it with the keyboard, click and drag to change the value with the mouse.

Property types

Boolean (Bool)

  This Property type stores a binary value, meaning it can be "TRUE" or "FALSE". Be sure to write it all in capitals when using these values in Property Sensors or Expressions.

Integer (Int)

  Stores a number like 1,2,3,4,... in the range from -2147483647 to 2147483647.

Float

  Stores a floating point number.

String

  Stores a text string. You can also use Expressions or the Property Sensor to compare strings.

Timer

  This Property type is updated with the actual game time in seconds, starting from zero. On newly created objects the timer starts when the object is "born".

Prev | Home | Next
The RealtimeButtons | Up | Settings in the MaterialButtons