Getting the angle that velocity is applied to.

I’m quite new to Phaser and I need help with one quick question.

I am trying to find the angle of the green line as seen this image.
I need the angle for this line, “this.physics.velocityFromRotation(Angle Of The Line, player.body.speed, player.body.velocity);”

It’s probably player.rotation.

I have tried player.rotation, but player.rotation is different from the angle of the green line.

How is the car moving in the first place?

Technically the angle of the green velocity vector is body.angle but with velocityFromRotation() you’re also modifying that same vector.

Alright, I think I’m asking for the wrong thing. What I want to happen is the car to still be able to turn while deaccelerating. I was able to kind of achieve this with player.rotation, but It is choppy. Here is a link to the game with player.rotation, DriftR. Here is a screenshot of my code in its current state.

Instead of setMaxVelocity() I would try


and for drag:

player.setDrag(0.1); /* adjust */

This won’t help with what I’m trying to achieve. I want the car to be able to slow down while turning. With my current code, when you are turning and you stop accelerating it changes the direction of the velocity. This causes a sort of “boost” which I do not want, I just want it to be smooth.