Comments and answers for "Calculate Vector3 based on the other Vector3"
http://answers.unity.com/questions/1231067/calculate-vector3-based-on-the-other-vector3.html
The latest comments and answers for the question "Calculate Vector3 based on the other Vector3"Comment by meat5000
http://answers.unity.com/comments/1231223/view.html
Dont rely on Vector3 and its shortcuts. Convert them to Vector2.
Without going in to it too much, here's a snippet of code from a Camera-Relative setup.
The angle of the camera (in y) is basically replaced by your Right Stick.
#if UNITY_ANDROID
//ANDROID JOYSTICK
if(!Application.isEditor)
{
stickVector = Vector2(moveJoystick.position.x,moveJoystick.position.y);
}
#endif
var playerRotation : float = cameraCurrentT.rotation.eulerAngles.y - thisTransform.rotation.eulerAngles.y;
stickAngle = Vector2.Angle(Vector2(0,1),Vector2(stickVector.x,stickVector.y));
var stickAngleCross : Vector3 = Vector3.Cross(Vector2(0.0,1.0), stickVector);
if (stickAngleCross.z > 0.0)
stickAngle = 360.0 - stickAngle;
var inputRotQuat : Quaternion = Quaternion.AngleAxis((playerRotation),Vector3.up);
var stickTemp : Vector3 = Vector3(stickVector.x,0.0,stickVector.y);
modifierVector = inputRotQuat * stickTemp;
modifiedInput.x = modifierVector.x;
modifiedInput.y = modifierVector.z;Thu, 18 Aug 2016 16:46:05 GMTmeat5000Comment by g__l
http://answers.unity.com/comments/1231189/view.html
Nicely put together question, sadly i cannot assist you greatly but these links may send you in the right direction.
Finding the angle of a Vector - http://www.dummies.com/education/science/physics/how-to-find-the-angle-and-magnitude-of-a-vector/
Finding the angle between two Vectors - http://www.wikihow.com/Find-the-Angle-Between-Two-Vectors
@TheBoskiThu, 18 Aug 2016 15:43:58 GMTg__l