I'm trying to make it so when a player swims in water they'll get some effects. I put a region3 where the water is, and I want it so the effects only come up when the player's head is inside the region. But whenever I check to see if the player's head is inside the region, nothing happens.

for i,v in pairs(Detect) do
	Char.Humanoid.StateChanged:Connect(function(oldState,newState)
		if newState == Enum.HumanoidStateType.Swimming and v.Name == "Head" then
			WaterEnabled = true
		else
			WaterEnabled = false
		end
	end)
end

2 comments

0

What is Detect?

0

It's the parts inside of the region