I am trying to change a humanoidState to swimming when colliding with a part just to see if it would work but unfortunately it is not working, I’ve tried changing it to other things such as sitting or free falling but they did not work either, I’m not sure whats causing this and I’ve debugged the script and everything was running and printing.
floodPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print(hit.Parent.Name.." Touched part")
local Humanoid = hit.Parent.Humanoid
print("swimming")
Humanoid:SetStateEnabled("GettingUp", false)
Humanoid:SetStateEnabled("Seated", true)
print("initiated states")
end
end)