How to stop character flinging and briefly frozen?

I’m working on a dashing script that accelerates the character forward. The problem is, when it hits a wall the character goes flinging and is unmovable until it gets up, sometimes seconds later. Here is an example video:

I tried putting an AlignOrientation in the character with maximum Torque but it doesn’t work either:

I’ve also tried forcing the Pivot CFrame upright on RenderStepped and Stepped, and while this did make the character stay upright, the character would still freeze as if it had fallen over and not be able to move for a few seconds.

local minAngle = .0003
local printPeriodically = require(game.ReplicatedStorage.Util.printPeriodically)(7)
local debounce = false
local ATC = RunService.Stepped:Connect(function()
	if debounce then return end
	local ccf = character:GetPivot()
	local a,b,c = ccf:ToOrientation()
	if a >= minAngle or c >= minAngle then
		humanoidRootPart.AssemblyAngularVelocity = Vector3.new()
		humanoidRootPart.AssemblyLinearVelocity = Vector3.new()
		character:PivotTo(CFrame.new(ccf.Position) * CFrame.fromOrientation(0,b,0))
		print("AT activated")
		debounce = true
		task.delay(.77,function()
			debounce = false
		end)
	end
end)

I guess there’s some kind of internal Roblox character control script that is causing this brief freezing whenever the character falls over. How can I stop this from happening?

3 Likes

I made a test place for this issue:
fling testing.rbxl (54.6 KB)

The main script is in StartPlayerScripts

2 Likes

I believe this means Humanoid’s state changed to Enum.HumanoidStateType.FallingDown from the impact. You could try disabling the state.

humanoid:ChangeStateEnabled(Enum.HumanoidStateType.FallingDown, false)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.