- Home /
Vector 2 3 4 help
Ive been looking around for an explanation bout the vector 2 3 4 and i cant find one i looked at the script on the unity page and it just fly's over my head can any one explain in rudimentary terms
Answer by GuyTidhar · Jun 27, 2011 at 08:21 PM
Vectors are used to represent either a point in space or a line length and its direction.
Vector2 is used for representations in 2D spaces: X and Y axis, so when you define a variable typed Vector2, you can manipulate these 2 values, for instance:
var vec2 : Vector2 = new Vector2(5,8);
vec2 is defined as the position in 2D space of 5 units along the X axis, and 8 units along the 8 axis. now, I can keep in memory and change vec2 values.
Vector3 and Vector4, give you an ability to manipulate 3 axis and 4 axis/values.
All these vectors are of value type that holds 2, 3 or 4 floating variables in one type.
Being a value type, means, when you do a simple assignment of one vector to the second, you produce a copy of the original one, and changes you make on one of them do not take an effect on the other. This is as opposed to reference types (such as classes), that when you you assign, you do a copy of the reference to the memory only, and any change in one, effect the second.
If you are not familiar with vector math, you could try and do some tutorial about that, but I'm not sure this is what you wanted.
Your answer
Follow this Question
Related Questions
change the length of the vector 1 Answer
Good old trig and NaN 1 Answer
Getting vector which is pointing to the right/left of a direction vector? 2 Answers
Enemy and hero. Distance 1 Answer