Character Rotation (Combat)

Hello, this is my first post on the devfourm so bare with me.

I’m working on my first Combat Framework and everything seems to be working fine
although I’ve run into an issue where sometimes my Dummy doesn’t get up off the floor after the ragdoll time is over. (some issue with network owner)

Due to the way my script functions, If the dummy is stuck on the floor and you decide to downslam him, he over rotates onto his head as shown here: Watch Roblox VR 2024.10.17 - 09.39.46.12.DVR | Streamable

if Args.AttackType == "Downslam" and Args.Combo == 4 then	
   local hitSuccess = HitService.Hit(HitArgs)
   if hitSuccess then
       targetRoot.CFrame = targetRoot.CFrame * CFrame.Angles(math.rad(90),0,0)
   end
end

How can I optimize my script so that the target will rotate onto their back regardless of what their current rotation is?

Try this

if Args.AttackType == "Downslam" and Args.Combo == 4 then
    local hitSuccess = HitService.Hit(HitArgs)
    if hitSuccess then
        local position = targetRoot.Position
        
        -- Define the fixed rotation (lying on back, looking upward)
        local backRotation = CFrame.new(position) * CFrame.Angles(math.rad(-90), 0, 0)
        
        targetRoot.CFrame = backRotation
    end
end