Skip to content

Commit 07495be

Browse files
committed
Explain capability behaviors
1 parent 4ae847a commit 07495be

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎docs/gdevelop5/behaviors/events-based-behaviors/index.md‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,15 @@ Properties won't be usable from outside of the behavior. Properties are said to
151151

152152
## Rely on other behaviors
153153

154-
It is possible for behaviors to use other "required behaviors" as properties. When this is the case, GDevelop will ensure that any object using your behavior will also use the other one.
155-
You can then use the behavior entered as a property inside the actions, conditions, expressions and the lifecycle functions of your own behavior.
154+
You can use other behaviors in your behavior events. For example, you could make a behavior called "Platformer enemy" which uses the "Platformer object" behavior and adds specific actions, conditions and logic to make an enemy chase the player.
156155

157-
!!! tip
156+
First, you need to declare which behaviors you want to use by adding properties of type **required behavior** and choose the right **behavior type**.
158157

159-
This is an advanced feature that is helpful to create behaviors that are based on other. For example, you could make a behavior called "Platformer enemy" that is using the "Platformer object" behavior and adding specific actions, conditions and logic to make an enemy chase the player.
158+
![](required-behavior.png)
160159

161-
If you create a behavior and want to use this, just go to the properties of this behavior and add a new property. Choose the type "Required Behavior" for this property. You can then use this new behavior in the events of the behavior you just edited.
160+
!!! note
162161

163-
To use a behavior based on another, you don't need to do anything special! Just add it to your object as usual: any missing behavior will be added to your object, so you can start using it immediately.
162+
Notice the first required behavior **object with animations** in the screenshot above. This is a behavior you will only see in the extension editor. Instead of requiring a specific object like a sprite, you can use it to make your behavior compatible with all objects handling animations (sprite, 3d model, spine...).
164163

165164
## Write behaviors dedicated to your project
166165

156 KB
Loading

‎docs/gdevelop5/events/functions/index.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ When **Any object** is selected for the **object type**, the object can be used
8282

8383
Conditions and actions from behaviors can also be used in functions events. For this, behavior parameters must be added after an object parameter.
8484

85+
!!! note
86+
87+
You will notice some behaviors you only see in the extension editor for instance **object with animations**. Instead of requiring a specific object like a sprite, you can use this behavior to make your function compatible with all objects handling animations (sprite, 3d model, spine...).
88+
8589
#### Use parameter values
8690

8791
Number, string and boolean parameters can be compared with the same conditions as global and scene [variables](/gdevelop5/all-features/variables).

0 commit comments

Comments
 (0)