Attracted To

An object with the Attracted To behavior applied moves toward a single specified target, the object of attraction. Additional parameters allow you to adjust the area of influence that defines how close an object must be to move toward the object of attraction, and how strongly it is attracted.

Canvas showing animation path created using the Attracted To behavior

The Drag parameter lets you define whether attracted objects overshoot and bounce about the attracting object, or whether they eventually slow down and stop at the position of the target object.

You can apply two or more Attracted To behaviors to a single object, each with a different object of attraction, to create tug-of-war situations where the object bounces among all objects it’s attracted to.

Adjust this behavior using the controls in the Behaviors Inspector: