How do I remove/fix the automatic swim tilt feature?

Hello,

I’ve been struggling with the automatic swim tilt feature when a humanoid enters terrain water where they rotate 90 degrees forward on the Y axis. I haven’t been able to find a comprehensive solution. Specifically, I’ve looked through and edited the default ControlModule but couldn’t pinpoint where the vector switch occurs that causes the tilting - it might not even be in ControlModule but that was my first guess.

I understand that this issue has been raised by others as well. Some of the solutions I’ve come across include using BodyGyro to manually control the character’s orientation and making tweaks to the swimming animations to “offset” the tilt. Unfortunately, these fixes haven’t worked for me, as they either don’t fully address the problem or introduce new issues.

What I’m looking for is a catch-all fix that can handle the swim tilt universally without requiring extensive modifications or causing unintended side effects. If anyone has encountered this issue and managed to resolve it, I would greatly appreciate your insights and detailed guidance.

If there’s an efficient way to debug and locate the exact point in the ControlModule where this behavior is triggered, I’d love to learn about it. Or, if you happen to know/have a similarly efficient fix, I wouldn’t mind it either.

Thank you in advance.

1 Like

image
Have you looked into that property in the humanoid?

Thank you for the speedy response.

Unfortunately I have, and AutoRotate doesn’t seem to have any effect in water… for some reason. I think the tilt might have something to do with Roblox’s physics. Aside from that, I’m pretty clueless.

1 Like

ever find a solution? looking for the same thing

Apologies for the late response. I actually did! It’s more of a bandaid solution than a direct fix, but it nonetheless works fairly well.

I was able to use an AlignOrientation attached to a rootpart’s attachment that constantly updates to counter the automatic tilt, giving a mostly normal looking swim effect. It’ll look weird if you’re on land, so it should only be enabled when the humanoid’s state is swimming.

local Attachment=Instance.new('Attachment')
	Attachment.Parent=char.HumanoidRootPart
	Attachment.Name='SwimAttachment'

	local LV=Instance.new('AlignOrientation')  
	LV.Parent=Attachment
	LV.RigidityEnabled=true
	LV.Enabled=true
	LV.Name='SwimOrientation'
	LV.Attachment0= PartAttachment
	LV.Mode=Enum.OrientationAlignmentMode.OneAttachment

	game:GetService('RunService').Heartbeat:Connect(function()
		if  LV and char:FindFirstChild('Humanoid') and char.Humanoid.MoveDirection.Magnitude ~=0
			and char:FindFirstChild('HumanoidRootPart')
		then
			LV.CFrame =CFrame.lookAt(char.PrimaryPart.Position - char.Humanoid.MoveDirection,char.PrimaryPart.Position)
		end
	end)

For NPC characters you can use a similar solution:

local moveDirection = -char:FindFirstChild('HumanoidRootPart').AssemblyLinearVelocity.Unit
local angleY = math.atan2(moveDirection.X, moveDirection.Z)
LV.CFrame = CFrame.Angles(0, angleY, 0)
1 Like

Thanks for the info, I actually just ended up making my own swimming mechanics but this may help in the future!

1 Like