Objects in the World (and their properties) can be referenced in a variety of ways within a behavior. This creates a great deal of flexibility, but may lead to some unexpected results.
The following are intended as guidelines to help you produce robust and predictable behaviors.
This Object Reference
The use of
"this" should be used whenever you are operating on the object where the behavior has been defined. Resist using the object name explicitly. By using
this object, you are guaranteed to operate on the right object.
The reference is listed in the object browser and can be accessed under the "this" tab, which also shows the properties for the active object.
For example, when the current object contacts something else, change its orientation.
Event References
Whenever you are creating a behavior, it's event will be listed under the "other" tab in the Values section of the Behavior Builder. Clicking on the event will show you certain properties of the event, some of which can then be clicked on as well to see what the value references. This image shows the location of the Event object.

And clicking on the Event object will show you the properties. In this case, we are looking at a collision event, which shows certain properties that describe the collision occurrence:

If we wanted to change the orientation of the object that "this" object collided with, we would click on the "actor2" reference in the Property list, which will show us the properties for that actor which can be dragged into the action, giving us this result:

Looping References
When you loop across multiple instances of an object - even if you are doing it from within an object's behavior - you can define your own name to use inside the for-each action. In any location that a new object reference is defined, you can click on that reference to see the properties associated with that object. In this case, we are looping across all rectangles and changing their fill color. The fill color is accessed by clicking on the first occurrence of "rectangle instance," where it is defined.
Application and Worl
The
Application and
World objects are always available in the behavior editor. They are listed along with other objects within the object browser, under the "actors" tab and can be clicked on to access their properties just like the other named references: