1

**PlayMaker Help / Re: Joystick Direction to Rotation angle**

« **on:**June 19, 2013, 06:42:17 PM »

I've made some progress on this. I've incorporated this solution http://answers.unity3d.com/questions/181867/is-there-way-to-find-a-negative-angle.html into a new operation on the Vector3 operator.

case Vector3Operation.NegativeAngle:

var angle = Vector3.Angle(v1, v2);

var cross = Vector3.Cross(v1, v2);

if (cross.y < 0) angle = -angle;

storeFloatResult.Value = angle;

break;

And it appears to be returning the type of results I am looking for, however the direction might need to be flipped.

Success!:

case Vector3Operation.NegativeAngle:

var angle = Vector3.Angle(v1, v2);

var cross = Vector3.Cross(v1, v2);

if (cross.y < 0) angle = -angle;

storeFloatResult.Value = angle;

break;

And it appears to be returning the type of results I am looking for, however the direction might need to be flipped.

Success!: