How can you prevent flinging when the player is moving at high velocities?

I’m creating a dodge roll mechanic in my game, and one of the things I’m having trouble with is dealing with certain physics interactions. My dodge roll is set up like this:

  1. Player’s AutoRotate is turned off and their character is rotated in the direction they’ll be launched. They also lose control of their character.
  2. The MaxForce and Velocity properties of the BodyVelocity object inside of the player’s HRP are set (max MaxForce, and a BodyVelocity with a magnitude of ~50 studs/s). The direction of the Velocity vector is the same as the HRP’s lookVector. Power stays at the default 1250.
  3. After .2s, the MaxForce is set to the zero vector, AutoRotate is turned back on, and the player regains control

Here’s a video of the issue (the standard Roblox flinging we’re all familiar with):
robloxapp-20211230-0321577.wmv (310.1 KB)

This has worked surprisingly well in creating a roll that feels good to use. However, I’m not entirely sure how I should prevent flinging. It’s especially bad when the player’s character collides with other humanoids. Would really appreciate a solution because I’m not entirely sure how to approach this. The desired behavior would simply be, in the case of the video, the player colliding with the dummy and being stopped by it. Thanks.

1 Like

Could you possibly send a video of player’s character flinging? That’d help really much.

I’ve added a video to the original post per your request

Okay… I am really really sorry to say that, but I also have no idea how to fix this. Sorry, and have a great rest of your day.

Eventually if I get something in my mind I’m gonna suggest you.

“Flinging” is caused by the humanoid state “Ragdoll”. Simply disable it on the client…

2 Likes
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)

Humanoid:SetStateEnabled
HumanoidStateType

Referencing the reply by @RatiusRat ^^

3 Likes

The only idea I have is to change the player’s collision group so that it ignores other players. This may cause other problems though.

make maxforce less, too much will fling the player

Here is the script I use to prevent the player from getting flung after rolling

local connection
connection = char.Hitbox.Touched:Connect(function(part)  -- make hitbox whatever part for collisions
	if part ~= workspace:FindFirstChild("Baseplate") then
		if humrp.Position.Y < part.Position.Y + part.Size.Y/2 then
			V:Destroy()   --destroy velocity 
		end
	end
end)

Make sure to use Connection:Disconnect after you are done using the script

2 Likes