Behavior object groups #3001
Replies: 1 comment 2 replies
-
I really like this idea. It would declare a behavior as a friend and each function will have a new object next to the "this" Object?
I think that an extension should probably never link objects because it could conflict with the events from the scene. Also, a Sticker can be a StickerHolder too. With a link you can't know which one is the sticker or the holder.
This case is setting the behavior itself as a friend? |
Beta Was this translation helpful? Give feedback.
-
The problem
An common, nice and intuitive design pattern in GDevelop builtin extensions is to have a behavior to mark some objects as to be used by another one, for example the platform or pathfinding obstacle behaviors. While those are just as doable in events based extensions by storing the necessary user data in a global variable, it is not a very user friendly way to do things.
My solution
Behavior object groups! The concept is simple, the whole extension gets access for each behavior it defines to an object group referring every object that have the behavior activated at the beginning of the frame. This would allow to easily use those from another behavior (for example "If Object is in collision with TriggerBehaviorObjects then do X").
Beta Was this translation helpful? Give feedback.
All reactions