playMaker

Author Topic: Convert 2D rotation into Vector2 [SOLVED]  (Read 322 times)

3D Lunatic

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
Convert 2D rotation into Vector2 [SOLVED]
« on: November 04, 2019, 02:11:57 AM »
I'm making a 2D pinball game. I need to convert an object's rotation into a Vector2 variable. The rotation will only be around the Z axis, as it's a 2D game. Is there an action which will do this for me?

Thanks!
« Last Edit: November 07, 2019, 12:41:15 PM by 3D Lunatic »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15396
  • Official Playmaker Support
    • View Profile
Re: Convert 2D rotation into Vector2
« Reply #1 on: November 05, 2019, 12:01:46 AM »
Hi,

 yes, use TransformDirection action.

use the x axis as the pointing vector that defines your direction ( against the rotating z axis).

this will give you its current direction in world space.

then you can extract the direction values and put it in a vector2 if you want.

Bye,

 Jean