Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

I would like more of an explanation of what you're trying to do. As far as I understand you want to rotate

If you are using rigidbody anyway you shouldn't be using transform.position instead use _rigidbody.AddForce(new Vector3(movement, 0, 0) * Time.deltaTime * MovementSpeed) or so.

I don't understand why you change the scale, but I foresee your character getting stuck on something.

Now the actual rotating part. If you just want to rotate your character (lets say 10° every frame)

private void Update()
{
     transform.rotation*=Quaternion.eulerAngles(0,0,10); //EDIT: it should be just Euler instead of eulerAngles!
}

I had my falling out with Quaternions, but now I bested them. Rotation in Unity is represented by them and unlike normal vectors you can't add them you must multiply them.

Alternatively you can use the rigidbody to rotate.

rb.AddTorque(new Vector3(0,0,10*Time.deltaTime*roattionSpeed));