playMaker

Author Topic: How to get a 360° angle between two vector3[SOLVED]  (Read 412 times)

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
How to get a 360° angle between two vector3[SOLVED]
« on: February 13, 2018, 07:03:07 AM »
With a the "Vector3 Operator" I've got a 180° angle.
It cause in my project fliping angle bug.

I guess I'll could find a way to solve it if I got a 360° angle, right now I work with two 180° angle that I select with the help of playerPosition vector3 (Player is it at the left or the right of the object then do this action etc.).
« Last Edit: February 15, 2018, 12:44:29 AM by jeanfabre »

Kathar

  • Playmaker Newbie
  • *
  • Posts: 48
    • View Profile
Re: How to get a 360° angle between two vector3
« Reply #1 on: February 13, 2018, 12:49:19 PM »
Sorry if I've misunderstood, but if your issue is that your GameObjects are flipping/looping oddly when you're trying to rotate them, it may be better to try using Quaternion Rotations instead of Euler Angles.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13432
  • Official Playmaker Support
    • View Profile
Re: How to get a 360° angle between two vector3
« Reply #2 on: February 14, 2018, 01:35:46 AM »
Hi,

 this is tricky indeed. Basically, you'll need a signed angle, otherwise indeed angles between two vector can not be more than 180 degree,

check the action GetSignedAngleToTarget action on the Ecosystem, this will allow to progress on knowing where you are.

Bye,

 Jean


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13432
  • Official Playmaker Support
    • View Profile
Re: How to get a 360° angle between two vector3
« Reply #3 on: February 15, 2018, 12:44:18 AM »
Hi,

 ok, I get it, it's easy actually, you just do 360-angle if angle is negative, that's all there is to it.

 I made an action to do this, available on the Ecosystem: get360AngleToTarget.



Bye,

 Jean