How to make an object go forward direction?

Pulse 3 years ago 0

I'm making a 3d low poly car game. I have done the rotation of the car but I want it to move forward and look to the direction it is looking. Like, if I rotate a little bit to the right go to this direction and not all the time to the same direction.

I have already tested transform.translate, it works, but when I rotate on x or y axis (when I collide) it try go to this direction so it goes crazy. If I freeze the rotation of z and x axis, it works but when you jump or collide has a unealistic feeling. Here is the script:

So how I fix this script or if you know another one that fit more there all ideas are welcome :DD

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):