DragDetectorクラス

クラス日本語解説は準備中

ひとことで言うと

DragDetectorは、ロブロックス(Roblox)のクラスです。くわしい日本語解説は準備中のため、下に公式の説明(英語)を載せています。

公式の説明(英語):Instance which facilitates and encourages interaction with 3D objects in an experience.

クラスの関係

受け継いでいるクラス:Object → Instance → ClickDetector → DragDetector

プロパティ(27)

名前と書き方説明
ActivatedCursorIcon
DragDetector.ActivatedCursorIcon: ContentId
Sets the cursor icon to display when the mouse is activated over the parent of this DragDetector.
ActivatedCursorIconContent
DragDetector.ActivatedCursorIconContent: Content
Sets the cursor icon to display when the mouse is activated over the parent of this DragDetector. Only supports asset URIs
ApplyAtCenterOfMass
DragDetector.ApplyAtCenterOfMass: boolean
Whether constraint force is applied to the object's center of mass.
Axis
DragDetector.Axis: Vector3
The primary axis of motion, expressed relative to the reference frame.
DragFrame
DragDetector.DragFrame: CFrame
The CFrame of the pivot, dependent on the drag detector's Class.DragDetector.ReferenceInstance|ReferenceInstance.
DragStyle
DragDetector.DragStyle: DragDetectorDragStyle
The paradigm used to generate proposed motion.
Enabled
DragDetector.Enabled: boolean
Whether the DragDetector responds to user input.
GamepadModeSwitchKeyCode
DragDetector.GamepadModeSwitchKeyCode: KeyCode
During gamepad input, the modifier KeyCode for the secondary mode of motion.
KeyboardModeSwitchKeyCode
DragDetector.KeyboardModeSwitchKeyCode: KeyCode
During keyboard input, the modifier KeyCode for the secondary mode of motion.
MaxDragAngle
DragDetector.MaxDragAngle: float
Along with Class.DragDetector.MinDragAngle|MinDragAngle, impedes the drag detector's attempts to generate motion.
MaxDragTranslation
DragDetector.MaxDragTranslation: Vector3
Along with Class.DragDetector.MinDragTranslation|MinDragTranslation, impedes the drag detector's attempts to generate motion.
MaxForce
DragDetector.MaxForce: float
Maximum force applied for the object to reach its goal.
MaxTorque
DragDetector.MaxTorque: float
Maximum torque applied for the object to reach its goal.
MinDragAngle
DragDetector.MinDragAngle: float
Along with Class.DragDetector.MaxDragAngle|MaxDragAngle, impedes the drag detector's attempts to generate motion.
MinDragTranslation
DragDetector.MinDragTranslation: Vector3
Along with Class.DragDetector.MaxDragTranslation|MaxDragTranslation, impedes the drag detector's attempts to generate motion.
Orientation
DragDetector.Orientation: Vector3
Specifies the **YXZ** rotation of axes of motion relative to the reference frame.
PermissionPolicy
DragDetector.PermissionPolicy: DragDetectorPermissionPolicy
Controls the permission level for which players can interact with the DragDetector.
ReferenceInstance
DragDetector.ReferenceInstance: Instance
An instance whose CFrame is the reference frame for the drag detector.
ResponseStyle
DragDetector.ResponseStyle: DragDetectorResponseStyle
The paradigm used to move, or not move, the objects affected by the drag detector.
Responsiveness
DragDetector.Responsiveness: float
Higher values cause the object to reach its goal more rapidly.
RunLocally
DragDetector.RunLocally: boolean
Whether user input on a DragDetector replicates to the server or remains local to the specific client.
SecondaryAxis
DragDetector.SecondaryAxis: Vector3
The secondary axis of the motion.
TrackballRadialPullFactor
DragDetector.TrackballRadialPullFactor: float
If Class.DragDetector.DragStyle|DragStyle is DragDetectorDragStyle.RotateTrackball, multiplier for adding a radial pull rotation as a contribution to the total.
TrackballRollFactor
DragDetector.TrackballRollFactor: float
If Class.DragDetector.DragStyle|DragStyle is DragDetectorDragStyle.RotateTrackball, multiplier for adding roll rotation to the total.
VRSwitchKeyCode
DragDetector.VRSwitchKeyCode: KeyCode
During VR input, the modifier KeyCode for the secondary mode of motion.
WorldAxis
DragDetector.WorldAxis: Vector3
The Class.DragDetector.Axis|Axis expressed in world space.
WorldSecondaryAxis
DragDetector.WorldSecondaryAxis: Vector3
The Class.DragDetector.SecondaryAxis|SecondaryAxis expressed in world space.

メソッド(5)

名前と書き方説明
AddConstraintFunction
DragDetector:AddConstraintFunction(priority: int, function: Function): RBXScriptConnection
Adds a function to modify or constrain proposed motion.
GetReferenceFrame
DragDetector:GetReferenceFrame(): CFrame
Returns the reference CFrame in which motion is expressed.
RestartDrag
DragDetector:RestartDrag(): ()
May be invoked from a script to restart the drag using new parameters.
SetDragStyleFunction
DragDetector:SetDragStyleFunction(function: Function): ()
Passes a function to be used if and only if Class.DragDetector.DragStyle|DragStyle is set to DragDetectorDragStyle.Scriptable.
SetPermissionPolicyFunction
DragDetector:SetPermissionPolicyFunction(function: Function): ()
Passes a function to be used if and only if Class.DragDetector.PermissionPolicy|PermissionPolicy is set to DragDetectorPermissionPolicy.Scriptable.

イベント(3)

名前と書き方説明
DragContinue
DragDetector.DragContinue(playerWhoDragged: Player, cursorRay: Ray, viewFrame: CFrame, vrInputFrame: OptionalCoordinateFrame, isModeSwitchKeyDown: boolean)
Fires when a user continues dragging the object after Class.DragDetector.DragStart|DragStart has been initiated.
DragEnd
DragDetector.DragEnd(playerWhoDragged: Player)
Fires when a user stops dragging the object.
DragStart
DragDetector.DragStart(playerWhoDragged: Player, cursorRay: Ray, viewFrame: CFrame, hitFrame: CFrame, clickedPart: BasePart, vrInputFrame: OptionalCoordinateFrame, isModeSwitchKeyDown: boolean)
Fires when a user starts dragging the object.

受け継いでいるメンバー

ClickDetector から受け継いでいるもの(7)

CursorIcon・CursorIconContent・MaxActivationDistance・MouseClick・MouseHoverEnter・MouseHoverLeave・RightMouseClick

Instance から受け継いでいるもの(46)

Archivable・Capabilities・IsInSandbox・Name・Parent・PredictionMode・Sandboxed・AddTag・ClearAllChildren・Clone・Destroy・FindFirstAncestor・FindFirstAncestorOfClass・FindFirstAncestorWhichIsA・FindFirstChild・FindFirstChildOfClass・FindFirstChildWhichIsA・FindFirstDescendant・GetActor・GetAttribute・GetAttributeChangedSignal・GetAttributes・GetChildren・GetDebugId・GetDescendants・GetFullName・GetStyled・GetStyledPropertyChangedSignal・GetTags・HasTag・IsAncestorOf・IsDescendantOf・IsPropertyModified・QueryDescendants・RemoveTag・ResetPropertyToDefault・SetAttribute・WaitForChild・AncestryChanged・AttributeChanged・ChildAdded・ChildRemoved・DescendantAdded・DescendantRemoving・Destroying・StyledPropertiesChanged

Object から受け継いでいるもの(4)

ClassName・GetPropertyChangedSignal・IsA・Changed

英語の説明とメンバーの一覧は、Roblox Creator Documentation(DragDetector)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。

執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。沖縄マイクラ部 クロスウェーブで、ロブロックス(Roblox)・マインクラフト(マイクラ)・Scratchなどのプログラミングを指導。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにロブロックス(Roblox)やマインクラフト(マイクラ)のプログラミングを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む