From BlenderWiki

Jump to: navigation, search

If you want to document Blender 2.5 features please edit pages under Doc:2.5/Manual.
If a "2.5" page doesn't exist please copy the text from 2.4x Manual and edit the new page (i.e. you should paste the wikitext from this 2.4x page to this new 2.5x page and then update the latter with 2.5 features)


[edit] Property Actuator

The property actuator has four modes:

  • Assign: the Prop field sets the target property, and the Value one, the value which the property will be given once the actuator is activated.
  • Add increases the value of the property, enter a negative value to decrease. For Bool, a value other 0 (also negative) is counted as True.
  • Copy copies a property from another object to a property of the actuator owner.
  • Toggle switches 0 to 1 and any other number than 0 to 0. Useful for on/off switches.

Game Logic python API.

[edit] Example

You have a character, it has a property called “hp” (hit points) to determine when he has taken enough damage to die. hp is an int with the start value of 100.

You set up two Collision sensors, one for enemy bullets, and one for picking up more health. The first one is connected (through an AND controller) to an Add Property actuator with the property hp and the value -10. Every time the player is hit by an enemy bullet he loses 10 hp. The other sensor is connected (through an AND controller) to an other Add Property actuator, this one with the value 50. So every time the player collides with a health item the hp increases by 50. Next you set up a Property sensor for an interval, greater than 100. This is connected (through an AND controller) to an Assign Property actuator which is set to 100. So if the players hp increases over 100 it is set to 100.