playMaker

Author Topic: Find Direction of Rotation  (Read 1274 times)

RobMadden

  • Playmaker Newbie
  • *
  • Posts: 3
Find Direction of Rotation
« on: April 22, 2020, 05:07:36 PM »
Hi folks,

I'm having trouble figuring out how to find whether my object is rotating to its left or right.

Currently I am setting an intended forward vector and using Smooth Look at Direction to rotate towards that vector. But I want to know if my object is turning right or left.

I tried finding my objects rotation, then having it rotate and checking the new rotation against the old. > or < tell me Right or Left no problem. But the issue is when it rotates from 10 to 350. It's rotated left but thinks it's turned right because of the >.

Any ideas would be greatly appreciated!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Find Direction of Rotation
« Reply #1 on: April 23, 2020, 04:34:27 AM »
Hi,

 you should take a relative approach, save the last rotation of the last frame, and compare it to the new one, there are actions on the Ecosystem to get a signed angle, try them to see which one fits best your need.



Bye,

 Jean

RobMadden

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Find Direction of Rotation
« Reply #2 on: April 23, 2020, 05:09:20 AM »
Hi Jean,

Thanks for the reply - I'm new to Playmaker and did not know about the Ecosystem at all! I will dig into the Actions you suggested.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Find Direction of Rotation
« Reply #3 on: April 29, 2020, 01:35:15 AM »
Hi,

 cool! let me know how it goes.

Bye,

 Jean