So I am doing a simple door. The idea is having two types of doors placed. Open version and closed one. the open version of the door is transparent and have turned off collisions, closed doors have it the other way. What I am doing is having click detector in the door part, and a script which checks if the click decetor has been clicked. If yes it will make collisions false and transaprency 1 for the closed doors, and turn on collisions and transparency to 0 for the opened door. The problem is that when i click the doors, it makes the closed doors transparent and collisons turned off which is what i want BUT the opened doors version doesnt get visible nor collisons turned on, here is script I use for both of the door.:
function onClicked() script.Parent.Parent.door1.Transparency = 1 script.Parent.Parent.door1.CanCollide = false script.Parent.Parent.door2.Transparency =0 script.Parent.Parent.door2.CanCollide = true end script.Parent.ClickDetector.MouseClick:connect (onClicked)
try deleting the script in door2 and then do
script.Parent.ClickDetector.MouseClick:Connect(function() script.Parent.Transparency = 1 script.Parent.CanCollide = false script.Parent.Parent.door2.Transparency = 0 script.Parent.door2.CanCollide = true end)
if that doesn't work too then dm me on discord:
The door were not anchored :D When I anchored them, it worked correctly