Component:Slider: Difference between revisions

From Resonite Wiki
add template
fix
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{stub}}'''See [[Component:Slider`1]] for the UIX Slider component.'''{{Infobox Component
{{Infobox Component
|Image=SliderComponent.png
|Image=SliderComponent.png
|Name=Slider
|Name=Slider
}}
}}
== Intoduction ==
The '''Slider''' component allows for an object to be grabbed and moved. See [[#Usage|Usage]] for more information.
== Usage ==
 
{{Note|If you need a 2D slider for [[UIX]] as an element, see the [[Component:Slider`1|UIX Slider]] component.|suggestion}}
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|EditModeOnly|Bool|  
|EditModeOnly|Bool| Determines if this grabbable is effective only in [[Edit Mode]]
|AllowSteal|Bool|  
|AllowSteal|Bool| Other users can grab the slot this component is attached to. Like a flag in capture the flag.
|DropOnDisable|Bool|  
|DropOnDisable|Bool| The parent slot will be dropped when this component is disabled.
|DontDrive|Bool|  
|DontDrive|Bool| Write the transforms every game tick, rather than driving it on the local machine and then sending the final value to the host.
|AllowOnlyPhysicalGrab|Bool|  
|AllowOnlyPhysicalGrab|Bool| Only allow grab an object with a physical interaction - remote grabs are not allowed
|ActiveUserFilter|ActiveUserHandling|  
|ActiveUserFilter|ActiveUserHandling| Changes if this component can be grabbed based on who is the active user if any.
|CustomGrabCheck|GrabCheck|  
|CustomGrabCheck|{{RootFieldType|SyncDelegate`1|[[Type:GrabCheck|GrabCheck]]}}|TypeAdv6=true| ''Not Usable inside Resonite'' Requires a mod for interacting with [[Sync Delegates]]
|_grabber|Grabber|
|_grabber|'''[[Component:Grabber|Grabber]]'''|TypeAdv7=true| ''Automatically Assigned'', the grabber that is grabbing this component.
|_holdSlot|Slot|  
|_holdSlot|Slot| The slot that is "holding" this slot, but not actually acting as this slider's parent.
|_pos|Float3|  
|_pos|{{RootFieldType|DriveRef`1|[[Type:Sync`1|Sync`1]]<[[Type:Float3|Float3]]>}}|TypeAdv9=true| The field this is currently driving for position.
|_rot|FloatQ|  
|_rot|{{RootFieldType|DriveRef`1|[[Type:Sync`1|Sync`1]]<[[Type:FloatQ|FloatQ]]>}}|TypeAdv10=true| The field this is currently driving for rotation.
|_scl|Float3|  
|_scl|{{RootFieldType|DriveRef`1|[[Type:Sync`1|Sync`1]]<[[Type:Float3|Float3]]>}}|TypeAdv11=true| The field this is currently driving for scale.
|__legacyActiveUserRootOnly|Bool|  
|__legacyActiveUserRootOnly|Bool| ''Automatically Assigned'' Legacy do not use. Used to handle whether only the active user can grab. Use <code>ActiveUserFilter</code> instead!
|GrabPriority|Int| {{Template:Grab Priority}}  
|GrabPriority|Int| {{Template:Grab Priority}}
|Rotatable|Bool|  
|Rotatable|Bool| Whether the slider object is rotatable.
|Scalable|Bool|  
|Scalable|Bool| Whether the slider is scalable.
|Range|Float3|  
|Range|Float3| The range that the object is allowed to move position wise.
|Origin|Float3|  
|Origin|Float3| The origin of the range that the object is allowed to move.
|MinScale|Float3|  
|MinScale|Float3| The minimum scale the object can be scaled to.
|MaxScale|Float3|  
|MaxScale|Float3| The maximum scale the object can be scaled to.
|VibrationOffset|Float|  
|VibrationOffset|Float| The offset of the vibration intensity.
|VibrationPreset|VibratePreset|  
|VibrationPreset|VibratePreset| The preset for triggering vibration with this object.
|SnapIncrement|Float|  
|SnapIncrement|Float| What increment the position of this object should snap to, instead of allowing smooth movement.
|SnapTime|Float|  
|SnapTime|Float| The time the object will take to move to a snap position when it snaps.
|SnapOnRelease|Bool|  
|SnapOnRelease|Bool| Only snap to positions in <code>SnapPositions</code> when released rather than always.
|SnapPositions|SnapPosition|  
|SnapPositions|{{RootFieldType|SyncList`1|[[#SnapPosition|Slider.SnapPosition]]}}|TypeAdv25=true| Positions to snap to while grabbing or when released.
|posOffset|Float3|  
|posOffset|Float3| How much to offset the slider's position.
|rotOffset|FloatQ|  
|rotOffset|FloatQ| How much to offset the slider's rotation.
|scaleReference|Float3|  
|scaleReference|Float3| The original scale reference value.
|referenceParent|Slot|  
|referenceParent|Slot| The slot that is supposed to be this slider's parent.
}}
 
== SnapPosition ==
{{Table TypeFields
|Position|Float3| The position to snap to and measure distance from.
|MaxDistance|Float| The distance the slider needs to be under from <code>Position</code> in local transforms to snap to it.
}}
}}
== Behavior ==
 
== Usage ==
This can be used for NPC pickups, grabbing objects and moving them without parenting under a user, or for sliding doors. this can also be used for physical sliders like on audio boards like mixers.
 
== Examples ==
== Examples ==
* [https://www.youtube.com/watch?v=9Ynl-d0l81E Slider - A useful alternative to Grabbable] by [[User:ProbablePrime|ProbablePrime]]
Slider - A useful alternative to Grabbable - by [[User:ProbablePrime|ProbablePrime]]:
<youtube>9Ynl-d0l81E</youtube>


== Related Components ==
== See Also ==
[[:Category:Draggable]]
[[Category:Components{{#translation:}}|Slider]]
[[Category:Components{{#translation:}}|Slider{{#translation:}}]]
[[Category:Components:Transform:Interaction{{#translation:}}|Slider]]
[[Category:Components:Transform:Interaction{{#translation:}}|Slider{{#translation:}}]]
[[Category:Components With Nested Types{{#translation:}}|Slider]]
[[Category:Draggable]]

Latest revision as of 23:38, 2 August 2025

Component image 
Slider component as seen in the Scene Inspector

The Slider component allows for an object to be grabbed and moved. See Usage for more information.

If you need a 2D slider for UIX as an element, see the UIX Slider component.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
EditModeOnly Bool Determines if this grabbable is effective only in Edit Mode
AllowSteal Bool Other users can grab the slot this component is attached to. Like a flag in capture the flag.
DropOnDisable Bool The parent slot will be dropped when this component is disabled.
DontDrive Bool Write the transforms every game tick, rather than driving it on the local machine and then sending the final value to the host.
AllowOnlyPhysicalGrab Bool Only allow grab an object with a physical interaction - remote grabs are not allowed
ActiveUserFilter ActiveUserHandling Changes if this component can be grabbed based on who is the active user if any.
CustomGrabCheck delegate of identity GrabCheck Not Usable inside Resonite Requires a mod for interacting with Sync Delegates
_grabber Grabber Automatically Assigned, the grabber that is grabbing this component.
_holdSlot Slot The slot that is "holding" this slot, but not actually acting as this slider's parent.
_pos reference drive of Sync`1<Float3> The field this is currently driving for position.
_rot reference drive of Sync`1<FloatQ> The field this is currently driving for rotation.
_scl reference drive of Sync`1<Float3> The field this is currently driving for scale.
__legacyActiveUserRootOnly Bool Automatically Assigned Legacy do not use. Used to handle whether only the active user can grab. Use ActiveUserFilter instead!
GrabPriority Int Determines what gets grabbed if several grabbable objects are touching someone's grab sphere. The IGrabbable with the highest priority will be grabbed first. If the highest priority ties with another IGrabbable, it will grab both of those and ignore any lower priority IGrabbables.
Rotatable Bool Whether the slider object is rotatable.
Scalable Bool Whether the slider is scalable.
Range Float3 The range that the object is allowed to move position wise.
Origin Float3 The origin of the range that the object is allowed to move.
MinScale Float3 The minimum scale the object can be scaled to.
MaxScale Float3 The maximum scale the object can be scaled to.
VibrationOffset Float The offset of the vibration intensity.
VibrationPreset VibratePreset The preset for triggering vibration with this object.
SnapIncrement Float What increment the position of this object should snap to, instead of allowing smooth movement.
SnapTime Float The time the object will take to move to a snap position when it snaps.
SnapOnRelease Bool Only snap to positions in SnapPositions when released rather than always.
SnapPositions list of Slider.SnapPosition Positions to snap to while grabbing or when released.
posOffset Float3 How much to offset the slider's position.
rotOffset FloatQ How much to offset the slider's rotation.
scaleReference Float3 The original scale reference value.
referenceParent Slot The slot that is supposed to be this slider's parent.

SnapPosition

Fields
Name Type Description
Position Float3 The position to snap to and measure distance from.
MaxDistance Float The distance the slider needs to be under from Position in local transforms to snap to it.

Usage

This can be used for NPC pickups, grabbing objects and moving them without parenting under a user, or for sliding doors. this can also be used for physical sliders like on audio boards like mixers.

Examples

Slider - A useful alternative to Grabbable - by ProbablePrime:

See Also