Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gdevelop:documentation:manual:edit_automatisms [2015/10/18 19:20] (current)
Line 1: Line 1:
 +====== Behaviors of objects ======
 +
 +Behaviors are premades features that can be used to add a specific behaviour to any kind of object.\\
 +For example, the [[gdevelop:​documentation:​manual:​built_physics|Physics behavior]] can be used to add a realistic behaviour to objects.
 +
 +===== Add behaviors to an object =====
 +
 +To see the behaviors of an object, make a right click on the object in the [[gdevelop:​documentation:​manual:​edit_object|objects editor]] and then click on Properties. Behaviors are shown in the window containing all the object properties:
 +
 +{{ gdevelop:​documentation:​manual:​editautomatisms.png?​nolink |}}
 +
 +The behaviors used by the object are displayed at the bottom of the list. To edit a behavior, simply edit the properties in the list.
 +To add or remove a behavior, use the ''​Add''​ and ''​Remove''​ buttons in the list.
 +
 +===== Using behaviors during the game =====
 +
 +When a behavior is added to an object, the behavior is enabled when the scene is launched. You can use the events to enable or disable behaviors of a specific object. For example, it can be useful to **disable useless behaviors** such as the [[gdevelop:​documentation:​manual:​built_layer|Light obstacle behavior]] or [[gdevelop:​documentation:​manual:​built_platformer|Platform behavior]], when objects are far from the player.
 +
 +Behaviors can also bring new actions, conditions or expressions:​ In this case, there will be a new category in the actions or conditions list.
 +
 +Most of the time, you should try to use as much as possible **actions or conditions of the behavior**: for example, when using the Physics behavior, you should not use the built-in force system to move the object, but rather use the actions provided by the behavior.