RestraintPluginModule
Module for the RestraintPlugin
Types
ConstraintRestraintConfig
interface
ConstraintRestraintConfig {
openAngle:
number
closedAngle:
number
--
Angle while restraint is closed and seat is empty
clampedAngle:
number
--
Angle while restraint is closed and a character is seated in the seat
}
All values are in degrees, as they are used to set the .Angle value of the HingeConstraint.
Properties
RestraintPlugin
RestraintPluginModule.RestraintPlugin:
RestraintPlugin
Restraint
RestraintPluginModule.Restraint:
Restraint
Restraint_Client
RestraintPluginModule.Restraint_Client:
Restraint_Client
Restraint_Server
RestraintPluginModule.Restraint_Server:
Restraint_Server
Functions
restraintsWithTag
Creates a function which gets descendants from a Model with the given tag.
clickRestraint
RestraintPluginModule.
clickRestraint
(
) →
(
)
Sets a Restraint so that it can be open/closed by clicking on it via a ClickDetector
Restraint model must have a child named ClickDetector
which is used to find or create a ClickDetector
.
If ClickDetector
is an ObjectValue, will use the .Value of the ObjectValue.
If ClickDetector
is a BasePart
, Model
, or Folder
:
- Will try to get the
ClickDetector
child of it. - If a
ClickDetector
cannot be found, creates one.
constraintRestraint
Sets a Restraint to be animated to open and close via a HingeConstraint.
Restraint model must have a child named RestraintConstraint
which is a HingeConstraint
or is an ObjectValue whose value is the HingeConstraint
The Config interface is constructed as follows:
type Config = {
openAngle: number,
closedAngle: number, -- Angle while restraint is closed and seat is empty
clampedAngle: number, -- Angle while restraint is closed and a character is seated in the seat
}
All values are in degrees, as they are used to set the .Angle value of the HingeConstraint.