Help with simple physics(checking if player is moving backwards.)

So I’m making a real simple skating game as my first project and i want semi-realistic physics and such.

So basically I move the player forward by an amount, this amount called “forwardVal” basically the players momentum.

What i want to achieve is making the forwardVal negative after sliding down slopes, so it moves backwards.

I cannot find a way to tell if the player is moving backwards, I’ve tried using :Dot but doesnt seem to work.

heres the code im using right as now.

if (forward:Dot(playerDirection) > 0) then
		forwardVal = -forwardVal
end

Any ideas?

if you want to get direction player is moving in you can use

Humanoid.MoveDirection