FloorConstraint - Verge3D User Manual - Soft8Soft
Description: Learn how to use FloorConstraint in your interactive 3D apps made with Verge3D

TargetConstraint →

# FloorConstraint

A constraint which restricts the position of the constrained object based on the target's position. Thus the target object behaves like an "inivisible wall", "floor", etc.

To influence some object, push a FloorConstraint instance into the Object3D.constraints array.

## Constructor

### FloorConstraint(target : Object3D)

target — constraint's target object.

## Properties

See the base TargetConstraint class for common properties.

### # .floorLocation : String

The axis to apply the restriction along. Can be one of the `"X"`, `"-X"`, `"Y"`, `"-Y"`, `"Z"`, `"-Z"`. Positive means that the constrained object's position along this axis can only be above the .offset value. Negative means - only under the .offset value. Default is `"Y"`.

### # .isFloorConstraint : Boolean

Read-only flag to check if a given object is of type FloorConstraint.

### # .offset : Float

The limiting value along the .floorLocation axis. Default is `0`.

### # .type : String

The constraint's type. Equals to `"FloorConstraint"`.

### # .useRotation : Boolean

When enabled, the constraint takes the target’s rotation into account. This allows you to have a “floor” plane of any orientation you like. Default is `false`.

## Methods

See the base TargetConstraint class for common methods.

## Source

For more info on how to obtain the source code of this module see this page.