<div class='sourceset sourceset-android'>Android</div>

```kotlin
@ExperimentalFollowingSubspaceApi
public sealed class FollowBehavior protected constructor()
```

A FollowBehavior controls the motion of content as it is following another target, such as a
user's head. Currently the options include "soft", which gradually catches up to the target and
"static", which does not continuously follow the target.

## Companion Object

#### Properties

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public const val DEFAULT_SOFT_DURATION_MS: Int
```

The default duration, in milliseconds, for a soft follow animation.

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public const val MIN_SOFT_DURATION_MS: Int
```

The minimum allowable duration in milliseconds for a soft follow animation.

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public val Static: FollowBehavior
```

The content is placed once based on the target's initial pose and does not follow
subsequent movements.

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public val Tight: FollowBehavior
```

The content follows the target as closely as possible.

#### Methods

<h2 id="soft-durationms">Soft</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
public fun Soft(
            @IntRange(from = MIN_SOFT_DURATION_MS.toLong())
            durationMs: Int = DEFAULT_SOFT_DURATION_MS
        ): FollowBehavior
```

Creates a behavior where the content smoothly animates to follow the target's movements,
creating a comfortable "soft follow" effect. This is implemented with the Hermite easing
algorithm, which accelerates the content then slows it down towards the end of the
motion, giving it a sense of real world physics. The use of the Hermite algorithm is not
optional but the total duration of the motion can be modified.

#### Parameters

| | |
| --- | --- |
| durationMs | Amount of milliseconds it takes for the content to catch up to the user. Default is `DEFAULT_SOFT_DURATION_MS` milliseconds. A value less than `MIN_SOFT_DURATION_MS` will be rounded up to `MIN_SOFT_DURATION_MS` to allow enough time to complete the content movement. |

#### Returns

| | |
| --- | --- |
|  | A [FollowBehavior](/jetpack-compose/androidx.xr.compose/compose/classes/FollowBehavior) instance configured for soft following. |