I need to check all parts touched this little green part
I making spawner of this two plates with random orientaion(like 0,90,180,360) and want to delete this wall if little green part touched it but they all anchored
Can someone help me?
I need to check all parts touched this little green part
I don’t think it matters if they are anchored or not for part detection. If they are non-collide. You’ll have to add a touch interest. You can do that by connecting to the touch event of the part.
im already try it and touch interest automaticly added when i insert script with
script.Parent.Touched
or i need to add before run game?
I’m assuming Touched
didn’t work, an alternative is BasePart:GetTouchingParts (roblox.com). You could probably use this and check if the part you want to remove is in that list.
I’ve had experience with this issue before. If the CanCollide is set to false then the part will need to be anchored but if you turn CanCollide to true it won’t have to be anchored. Can I see your script though?
I think it should work, i will try this later, thank you.
You need to do something like this (in this case I’ll add the part called part inside a model ) (• is tab, i can’t do tab bc im on mobile)
local part = game.Workspace.Model.Part
if part then
•part.Transparency = 1
•part.CanCollide = false
Its very simple
script.Parent.Touched:Connect(function(hit)
If hit then
- - code
end
end)
Im making spawner and its spawn a lot of chunks with same name, i cant Just find it by a = part.
It was an example I don’t know what your real part name is
You need to use workspace:GetPartsInPart() to detect what parts are touching.
GetTouchingParts shouldn’t be used, GetPartsInParts is the replacement and should be used instead.
Touched doesn’t work like that, Touched tells you when its touched, not getting all the parts touching.
You can change the name of each part by calling the part variable and doing .Name = “YourPartName”. What’s the green part for? Are you trying to Jerry rig a timer?
Thank you for your addition. I was not aware of this, good catch!