When I try to rotate my game object, it keeps moving in same direction. I think there is pretty basic solution but couldn't figure it out.
Here is my code:
private void Move()
{
rb.velocity = new Vector3( rb.velocity.x, rb.velocity.y, speed * forwardSpeedMultiplier * Time.deltaTime );
float xVelocity = horizontalInput * speedMultiplier * horizontalSpeed * Time.deltaTime;
float yVelocity = -verticalInput * speedMultiplier * verticalSpeed * Time.deltaTime;
rb.velocity = Vector3.Lerp(rb.velocity,
new Vector3(xVelocity, yVelocity, rb.velocity.z),
Time.deltaTime * smoothness);
}
Note that I am using a rigidbody to move it.
I try to add + transform.forward to the first line. It kind of works but it messes up the speed.
I know this is probably basic question but still would appreciate the help.