# Rotation by 45 degrees each time

**URL:** <https://forum.kirupa.com/t/rotation-by-45-degrees-each-time/123465>\
**Category:** Uncategorized\
**Created:** [September 23, 2004, 9:59pm UTC](https://forum.kirupa.com/t/rotation-by-45-degrees-each-time/123465 "2004-09-23T21:59:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gt\_X\_lt](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@gt\_X\_lt](https://forum.kirupa.com/u/gt_X_lt)\
**Post date:** [September 23, 2004, 9:59pm UTC](https://forum.kirupa.com/t/rotation-by-45-degrees-each-time/123465/1 "2004-09-23T21:59:20Z")

</div>

I would like to be able to rotate a movieclip by 45 degrees each time i press left or right.

I have got this

```auto

on (keyPress "<Right>") {
 _rotation=+45
}
on (keyPress "<Left>") {
 _rotation=-45
}

```

However, this moves the movie clip to the point of 45 degrees or minus 45 degrees depending on the key pressed.

I would like to add +45 to the rotation when i press the right key and -45 when i press the left key.

What have i done wrong. Please can you help me?
