The player's direction changes abruptly when they brush against or touch a wall

You can write your topic however you want, but you need to answer these questions:

  1. Hello, during the creation of my game and its movement system, I’ve run into a problem concerning vertical surfaces.

  2. For some reason, the player changes direction when a wall or any object brushes against or touches them from the side.

  3. I’ve tried changing the physics and even the rotation system, but it hasn’t worked. There’s also a solution that breaks my game quite a bit, and that’s the player’s or Humanoid’s Autorotation. I’m sure you know what this does.

I need some help or advice. I’m not sure if it’s relevant, but I’ll include how the turning and acceleration systems work. Obviously, there are other things like the camera module and some states, but I’d prefer not to show too much for now.

–Turning System (Both are executed via RenderStepped):

	local rotationValue = 0
		
		if TurnToLeft then
			rotationValue = TurnVelocity
		elseif TurnToRight then
			rotationValue = -TurnVelocity
		end
		
		if (TurnToLeft and TurnToRight) or (not TurnToLeft and not TurnToRight) then
			rotationValue = 0
		end
		
		local currentCFrame = RootPart.CFrame
		local rotationCFrame = CFrame.Angles(0, math.rad(rotationValue) * deltatime, 0)
		RootPart.CFrame = currentCFrame * rotationCFrame

–Acceleration System:


        if AccelerateFront then
			CurrentVelocity = CurrentVelocity + AcceleratesVelocity * deltatime
		elseif AccelerateBack then
			CurrentVelocity = CurrentVelocity - AcceleratesVelocity * deltatime
		else
			CurrentVelocity = CurrentVelocity
		end
...

		--Player Move
		local moveDirection = RootPart.CFrame.LookVector
		
		RootPart.AssemblyLinearVelocity = moveDirection * CurrentVelocity