Hello there fellow developers! Today I have model to share with you! It is a slider that exist in the 3D world. I originally made it because I needed a dimmer switch for a light in a room I was creating and then re-made it in response to a question in the #help-and-feedback:scripting-support category. I’m releasing it now because I noticed that there aren’t any resources like this and I’ve never noticed any games that had this feature. So as a way to give back to the community I decided to release it.
This slider is a lot like this resource by @Krystaltinan, but a physical model that has already been prebuilt:
You can view a working example of it here: https://gyazo.com/d562a9e706c9385fbffb9933d1978246
Do know, however, that while you can click and drag the slider, everything is done on a local script. This means that anything you do won’t replicate to other clients and other players won’t be able to see how you are moving the switch. This will fit some people use case’s and others not so much. However, this is only the first iteration and compared to what I’m currently making (V2), this model is obsolete and relatively crude in method and ability, although it does work.
Here’s a link to the model:
https://www.roblox.com/library/7133265907/Dimmer
And here’s a link to an example using the model:
https://www.roblox.com/library/7133206147/Dimmer-Example
Please let me know if you like it and/or any improvements you think I should add in V2. I’ll update this post when V2 is released.
Version 2 Info
V2 will be a ModuleScript instead of a pre-built model for ease of creating physical sliders. I will still have an example of a slider utilizing it though.
Current list of improvements that are going to be added in V2:
- Option for replicating the slider movement to other clients
- Ability to work in any orientation, even if that orientation changes
- Automatic setup on creation (although you’ll be able to customize this depending on your needs)
- Ability to enable or disable it
- Connect a function for whenever the slider is moved.
- Set the sliders position manually (with a function)
- Position and/or movement snapping (optional)