Is it possible to take the magnitude of an object on one axis and put it inside of a variable and give it to a separate object on a different axis? Does magnitude not work that way?
Asked
Active
Viewed 39 times
1 Answers
-1
//this is the first axis
Vector3 axis1 = whatever;
//this is the second axis
Vector3 axis2 = whatever;
//this normalizes the second axis
axis2.Normalize();
//this multiplies the the second axis with the first axis' magnitude
axis2 *= axis1.magnitude;

Joey Quinto
- 367
- 2
- 6
-
Thanks so much! This helps, but I think I don't understand if "whatever" is supposed to be a variable...? – theRelation Aug 29 '14 at 23:04
-
Please explain your answer rather than just posting code. – Tony Aug 29 '14 at 23:07
-
Thanks Tony! I could really use further explanation. Someone suggested what I'm really asking for is a way to take the position of something on one axis and pass it to a different object on a separate axis. – theRelation Aug 29 '14 at 23:15
-
And won't this throw an error at me for implicitly converting type? – theRelation Aug 29 '14 at 23:33
-
-1 for not explaining, ok sorry i figured that it was simple enough you could figure it out; edited the answer if you really had to effort to thumb down and post a comment, why couldn't you answer Tony? – Joey Quinto Sep 01 '14 at 21:57
-
How do i post sample code without answering my question? – theRelation Sep 03 '14 at 16:42
-
Sorry what are you asking? – Joey Quinto Sep 03 '14 at 18:03