How to make a part face the opposite direction of its velocity?

I need help making my part face the opposite direction it’s going in-

targetChar.HumanoidRootPart.CFrame = CFrame.new(targetChar.HumanoidRootPart.Position, -targetChar.HumanoidRootPart.Velocity + targetChar.HumanoidRootPart.Position)

i’ve tried this, but it results in a buggy mess once the target hits the ground:

here’s the entire part of the script that handles the changing of rotation:

local past = Vector3.new()
local current = targetChar.HumanoidRootPart.Position
local isStill = false
		
local getup = false
local con
con = game:GetService('RunService').Heartbeat:Connect(function()

		targetChar.HumanoidRootPart.CFrame = CFrame.new(targetChar.HumanoidRootPart.Position, -targetChar.HumanoidRootPart.Velocity + targetChar.HumanoidRootPart.Position)
		current = targetChar.HumanoidRootPart.Position
		if (current - past).Magnitude < 0.1 then
			if targetChar:FindFirstChild('Stun') and target.FloorMaterial ~= Enum.Material.Air then
				getup = true
				con:Disconnect()
				isStill = true
			end
		else
		isStill = false
	end
	past= targetChar.HumanoidRootPart.Position
end)
1 Like
local curpos = part.Position
part.Changed:Connect(function()
	local oldpos = oldpos-part.Velocity
	part.CFrame = CFrame.new(curpos,oldpos)
	curpos = part.Position
end)

Something like this?

Im sorry, i dont really understand the code here, what is this supposed to do?

local curpos = part.Position -- our current position
part.Changed:Connect(function() -- a changed function so it updates everytime
	local oldpos = oldpos-part.Velocity -- we calculate the old position of our part
	part.CFrame = CFrame.new(curpos,oldpos) -- we rotate our part though I am a bit skeptical this may break everything
	curpos = part.Position -- we re-set our current position
end)

tried something similar, unforunately still did not work- it still bugged out like in the video

Then I suppose you need to use bodygyro or the newer one AngularVelocity? I do not have much idea of it so I am of no use.

(I actually just saw your post and saw you are using the same method I gave you the code about LOL [sorry for that])