I want to make a ocean that rises and destroys a house by unanchoring the parts of the house.
The issue is that when the ocean rises, the parts of the house don’t unanchor and don’t even show up in the output console.
I tried making these scripts and looking for solutions but nothing worked and I don’t know why.
Script in ServerScriptService that moves the ocean up and back down:
for i=1, 550, 1 do
game.Workspace.Ocean.Position = game.Workspace.Ocean.Position + Vector3.new(0, 0.1, 0)
game.Workspace.Ocean.Position = Vector3.new(0, -90, 0)
Script in the ocean part that check if it touched another part:
if part.Name == "HousePart" then
part.Anchored = false
(I don’t know if it has to do with the actual properties of the blocks but if it does, the ocean is anchored, has CanCollide off, and has CanTouch on. The house parts are anchored, have CanCollide on, and have CanTouch on.)
There is no typo and even if there was, it should still print the part before it does the if statement. If you have discord, I can actually show you what is going on in game. Me and my friend have been trying to solve this for like two days lol.
Anchored parts don’t register touches with other anchored parts, especially when manually moving it. Overall, using .Touched tends to vary pretty heavily, but if you want to use it, you’d probably have to make some the house unanchored. A solution you could use would be BasePart:GetTouchingParts(), but since it doesn’t work with CanCollide = false parts, I recommend you look at this post: