Im tryna make a roller curtain blind, anyone can aid me on it?

hey, rookie here!

Im trying to achieve a literal roller curtain blind, it may be inspired from a door that goes up and down, smoothly as well.


image


i’ve been tried other solutions for a few days, but it might feel like im missing a simple solution or something, so im asking yall experts on the issues that broke the entire curtain altogether, mightve been a fatal error, maybe.


(yep it is gone since it is unanchored, therefore the slats just dropped off by the code dictated:)

-- local moveAmount = isDown and Vector3.new(0, 29, 0) or Vector3.new(0, -29, 0)

and finally, im not actually familar with coding… but more onto building and stuff, adding it to make everything in this game myself.
and there is no option but to make this from the ground up, so this issue might be irritating for you, therefore i apologise.
:sob:

to add for this to clear up the situation mentioned above:

the weldconstraint for holder is holder (0) and N/A(actually nothing) since the weld is actually useless in welding it with the rest of the slats, instead is now under the guide, and the first slat (1) is welded to guide. (part 0 is guide, part 1 is 1)

and for the weldconstraint for button, it is attached to the holder ( button (0), (button (1), and since the second button which connects with the first button that holds the proximityprompt, the welds are reduntant…
image
second button above acts to connect between holder and button
first button is coloured in white

and to also add: each slat is connected to other slats through weld constraints, for example.

whereby in slat 1’s weldconstraint is ( part 0 is guide ), ( part 1 is 1)
whereby in slat 2’s weldconstraint is (part 0 is 1), (part 1 is 2)
whereby in slat 2’s weldconstraint is (part 0 is 2), (part 1 is 3)
list goes on to slat 29.

and as i tried for all of the slats to follow the holder up and down in earlier cases, it didnt even follow even at the time, the holder is connected to 1 through the weld constraint.
Which was: ( part 0 is holder), ( part 1 is 1)

im so bricked up.

Recommend trying welds instead of weldconstraints

Just trying to get more details.
Do you want the blind to actually roll up and down similar to a toilet paper roll, or just a solid door that slides up and is hidden inside the wall, or are the slats supposed to fold up like venetian blinds?

If it’s the first case then don’t weld all the slats together since they won’t bend.

You’re trying to move welded Parts using Position won’t work if they are welded to an anchored part, or if the holder is anchored.

If it’s the second case just tween the entire door. Anchor the top blind slat, then weld all the others to it (I’d actually use a single door Part that’s the lighter colour and weld all the darker Parts to it but make them about .003 studs thicker so it appears like a series of slats).
Tween the Anchored Part and the other welded slats will follow it.

yes im thinking of the blind movement be similar to a toilet paper roll.

ima solve it abit later, then i will see if it is a solution or not…

This’ll be difficult with Constraints.
You’ll need a HingeConstraint between each of the slats.
You’ll need a HingeConstraint and a cylinder to roll the slats up and down.
You’ll need tracks on each side to support the slats (they could be transparent) so they won’t fling around when they are touched.

Since the slats are very thin they might clip into each other or the tracks and then fling. It’s a Roblox physics issue that has some workarounds but it can be glitchy.

You might be better off to use a single flat door with the slats welded to it, then slide it up into the wall with a cylinder housing pushed into the wall to simulate a housing for the roller and slat mechanism. You could hide the door by positioning it just past the face of the wall so you don’t see the slats move up inside it. It’d give the illusion of rolling up, but it won’t have all the issues with trying to keep multiple Constraints from glitching out.

You can use how materials and textures tile to your advantage to get a cheap and convincing result here. Make sure the Z axes on the orientation of your parts are -180 as they scale downwards:

local proximityPromptService = game:GetService('ProximityPromptService')

local tweenService = game:GetService('TweenService')

local TARGET_SIZE_Y = 0.5

local TWEEN_DURATION = 1

proximityPromptService.PromptTriggered:Connect(function(prompt: ProximityPrompt)
	local blind = prompt.Parent
	
	if not blind:IsA('BasePart') then
		return
	end
	
	if not blind:GetAttribute('OriginalSize') then -- you could implement this in some other way but im lazy
		blind:SetAttribute('OriginalSize', blind.Size)
		blind:SetAttribute('OriginalCFrame', blind.CFrame)
	end
	
	if blind:GetAttribute('Open') then
		blind:SetAttribute('Open', false) -- the blind is open so we close it
		
		tweenService:Create(blind, TweenInfo.new(TWEEN_DURATION), { Size = blind:GetAttribute('OriginalSize'); CFrame = blind:GetAttribute('OriginalCFrame'); }):Play()
	else
		blind:SetAttribute('Open', true) -- the blind is closed so we open it
		
		local originalSize = blind:GetAttribute('OriginalSize')
		local originalCFrame = blind:GetAttribute('OriginalCFrame')
		
		-- 1. calculate the difference between the original size and the target size
		local sizeDifference = originalSize.Y - TARGET_SIZE_Y
		local targetCFrame = originalCFrame - originalCFrame.UpVector * sizeDifference * 0.5 -- we are scaling it opposite to the part's Y axis
		
		local targetSize = Vector3.new(originalSize.X, TARGET_SIZE_Y, originalSize.Z)
		
		tweenService:Create(blind, TweenInfo.new(TWEEN_DURATION), { Size = targetSize; CFrame = targetCFrame }):Play()
	end
	
end)


blinds.rbxl (73.9 KB)

1 Like

this one i actually like, but ima try first.

just asking, but is it related to scottifly’s proposed solutions and possibilities for the roller blind?

Maybe, specifically the tweening part, but there are no constraints enabled whatsoever.

1 Like