object:setLimits()

Type Function
Object Joint
Library physics.*
Return value none
Revision Release 2022.3683
Keywords joint, setLimits
See also object:getLimits()
object.isLimitEnabled
Physics Joints (guide)

Overview

This function accepts two values which define the negative and positive range of motion for a "piston" joint. The second value should always be greater than or equal to the first value, since they define a range of motion (distance) along the axis.

Syntax

joint:setLimits( negLimit, posLimit )
negLimit, posLimit (required)

Numbers. Negative and positive values for the range of linear motion.

Example

myJoint.isLimitEnabled = true
myJoint:setLimits( 100, 200 )