Hello! So I’m making a door script and the problem is that when it’s opened I can for some reason go thorough that. However I cannot walk through some places.
CODE
local door = script.Parent
local open = false
local locked = false
local db = false
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut)
local openPos = CFrame.Angles(0,math.rad(90),0)*door.MainWeld.C0*CFrame.new(2,0,-2)
local closePos = door.MainWeld.C0
door.DoorPromt.Triggered:Connect(function()
if db == false and locked == false then
db = true
if open == false then
ts:Create(door.MainWeld,ti,{C0 = openPos}):Play()
else
ts:Create(door.MainWeld,ti,{C0 = closePos}):Play()
end
open = not open
wait(.5)
db = false
end
end)
door.DoorHandle.LockPromt.Triggered:Connect(function()
locked = not locked
end)
This sounds really basic but gotta make do
place a part that cant be gone through at the door open position.
when its open set cancollide to true.
when its closed set it to false.
Are you using any scripts related to character collisions? There’s a change that the collision script is using PhysicsService to set a Collision Group collision state between you and a group of parts(for example workspace:GetChildren()), and the script thinks door belongs to that group.
Well my best guess is that it’s either this, or the door CanCollide property is false. Are all the scripts made by you? and if no are you aware of what every script exactly does?
This man is right. If you want to get helped here, show how us the full script because nothing in your original post shows anything to do with CanCollide.
Heck is Roblox magic? Show us where that code is, unless you don’t wanna get helped.
Code in the post the is full script and the only script that interacts with the door. I telling that there no any scripts in game interacted with cancollide.