Dive for roblox football system being jittery while in shiftlock/ not getting desired look

  1. What do you want to achieve? Keep it simple and clear!
    So i’m making a dive script thats similar to two games football fusion and auto 3s. Heres an example of what it looks like in auto 3s:
External Media
  1. What is the issue? Include screenshots / videos if possible!
    While in shiftlock and jumping two things wrong happen. One it looks very jittery in the air unless im diving forward, and two when diving sideways its supposed to not change direction mid air it should be smooth and stay in the same direction until it lands then it can do whatever, but for some reason it decides to not go sideways while going sideways and changes direction to aim forward. So my main issue is really the dive changing mid air and being all jittery. Heres a video to show:
External Media
  1. What solutions have you tried so far? Did you look for solutions on the Creator Hub?
    I’ve tried to look up other people trying to simulate this dive and I did come across one however their solution looked nothing like the solution I was going for. I also tried looking into Apply impulses and how shiftlock and jumping can affect the orientation of the cframe but nothing seems to give me any luck.

Note: I’m highly sure that the issue stems from the orientation of the root part being slightly off because I tested it myself that when in shiftlock and not jumping my orientation would be something like 0,0,45 but while jumping in shiftlock and going that same direction it will be 0,0, 46.467 or some random slightly off number like that. So making the orientation somehow always be 0,0,45 will definitely solve this problem but I’ve tried so many times and I can’t seem to get it to be.

function DiveController:PerformDive(character, humanoid, root)

local moveDir = humanoid.MoveDirection
if moveDir.Magnitude == 0 then
	debounce = false
	return
end
local magnitude = moveDir.Magnitude
moveDir = Vector3.new(moveDir.X, 0, moveDir.Z).Unit



local look = root.CFrame.LookVector
local right = root.CFrame.RightVector

local forward = Vector3.new(look.X, 0, look.Z).Unit
local rightVector = Vector3.new(right.X, 0, right.Z).Unit

local forwardAmount = moveDir:Dot(forward)
local rightAmount = moveDir:Dot(rightVector)

local pitch = -math.rad(45) * forwardAmount
local roll = -math.rad(45) * rightAmount

local facingCFrame = CFrame.lookAt(
	root.Position,
	root.Position + moveDir
)

local diveCFrame =
	facingCFrame *
	CFrame.Angles(pitch, 0, roll)



humanoid.PlatformStand = true
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)


root.CFrame = diveCFrame


root:ApplyImpulse(moveDir * (350*magnitude) + Vector3.new(0, 30, 0))

task.wait(CONFIG.DIVE_DURATION)

humanoid.PlatformStand = false
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Hey Guys I ended up fixing it if anyone is interested. Basically the angular velocity of the rootpart gets changed when ur in shiftlock and jump and set platformstand to true so basically all u have to do to fix it is set angularvelocity = vector3.new(0,0,0) and it works perfectly. Heres the line:

root.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
root:ApplyImpulse(moveDir * (400) + Vector3.new(0,20,0))
root.AssemblyAngularVelocity = Vector3.new(0, 0, 0)

i set it before and after the impulse just to be safe but yeah good luck!