# Change the z rotation of my player?,how to adjust the z rotation of my player?

Hello, i am very new to unity, programming and C#. I have a small game set up where there is a player object in a river, and rocks spawn above and move straight down. when the player colides with the rocks, they rotate. since im going with a “Canoe” vibe i like this, but i want the canoe to slowly correct itself like its being paddled by a person. i was thinking a statment that checks if the canoe is the default rotation (in this case 180 degrees) and if it isnt issues a rotation force to correct it. any advice is appreciated, thanks!

``````public float speed = 15.0f;

public float maxVelocity = 4.0f;

private Vector2 screenBounds;

// Start is called before the first frame update
void Start()
{
screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z));
}

// Update is called once per frame
void Update()
{
PlayerMoveKeyboard();

//PlayerMoveKeyboardwasd();

if (transform.position.y < -screenBounds.y)
{
Destroy(this.gameObject);
}
//where im trying to get the rotation
if (gameObject.transform.rotation.eulerAngles.z < 180)
{

}

if (gameObject.transform.rotation.eulerAngles.z > 180)
{

}

}
//Moving With Arrow keys
void PlayerMoveKeyboard()
{
//force that pushes the player
float force = 0.0f;
//Max Velocity Of The Player
float velocity = Mathf.Abs(GetComponent<Rigidbody2D>().velocity.x);
//Get Horizonal Velocity
float h = Input.GetAxis("Horizontal");

if (h > 0)
{
if (velocity < maxVelocity)
{
force = speed;
}

}
else if (h < 0)
{
if (velocity < maxVelocity)
{
force = -speed;
}
}
}
//Moving with WASD (Unfinished)
void PlayerMoveKeyboardwasd()
{
float force = 0.0f;
float velocity = Mathf.Abs(GetComponent<Rigidbody2D>().velocity.x);

if (Input.GetKey(KeyCode.A))
{

}
if (Input.GetKey("d"))
{

}
}
``````

You can use transform.Rotate

You can change rotateamount, the higher the faster it goes.

Example:

``````Transform.Rotate(0,0,rotateamount)
``````