# Retrieving the current rotation of a custom PShape

**URL:** <https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042>\
**Category:** Coding Questions\
**Created:** [May 8, 2019, 4:19pm UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042 "2019-05-08T16:19:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [May 8, 2019, 4:19pm UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042/1 "2019-05-08T16:19:59Z")

</div>

I am teaching myself to code through coding games, I am currently working on asteroids.

The player is rendered as a custom PShape, and is rotated with ship.rotate(RotVel);  
RotVel is a float that is modified by the A and D keys.

In order to have the ship go in the direction it is facing I need to retrieve it’s rotation.

Is there any method to retrieve the current rotation, and if not, what should I do to get it?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 8, 2019, 9:12pm UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042/2 "2019-05-08T21:12:15Z")

</div>

> [@F53](#):
>
> RotVel

is the current angle

Please ask more specifically

---

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [May 8, 2019, 9:37pm UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042/3 "2019-05-08T21:37:19Z")

</div>

RotVel is the velocity of rotation, each frame ship.rotate(RotVel) is called

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 8, 2019, 9:40pm UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042/4 "2019-05-08T21:40:52Z")

</div>

No, it’s the current angle, it just adds up

😉

---

<div class="post-metadata">

**Author:** ![F53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f53/32/7118_2.png) [@F53](https://discourse.processing.org/u/F53)\
**Post date:** [May 9, 2019, 2:08am UTC](https://discourse.processing.org/t/retrieving-the-current-rotation-of-a-custom-pshape/11042/5 "2019-05-09T02:08:24Z")

</div>

Ohhh, that makes sense now.
