Understanding Arithmetic & Vector Data

I’m trying to understand the math involved in adding and multiplying vector data.

ADDING 2 VECTORS:

If I add 2 vectors
(2,3,1) + (1,1,4) ,
Will that give me
(3,4,5)
?

 Does it add them together?

MULTIPLYING AGAINST A FLOAT

If I multiply a vector (2,3,4) * 3.5 , is it multiplying all 3 numbers against the float individually to give me (7,10.5, 14)?

Again, just trying to understand what’s going on under the hood a little better.

Yes it is. Addition creates a new vector out of all the vectors you are adding. Multiplication extends the vector if the scalar is greater than 1 and reduces it if smaller than 1. At 0, you have a vector zero, less than 0 you invert the direction of the vector. Dividing is the same process. http://docs.unity3d.com/Documentation/Manual/UnderstandingVectorArithmetic.html

Yes, it is not even an option anymore that I see.

Yes, .active is deprecated and replaced with .activeInHierarchy [https://docs.unity3d.com/2020.1/Documentation/ScriptReference/GameObject-activeInHierarchy.html][1] [1]: https://docs.unity3d.com/2020.1/Documentation/ScriptReference/GameObject-activeInHierarchy.html

1 Answer

1

Yes that is right. Here’s some more Vectors

Thanks so much for the help!

This is great, but the thing I'm not clear on is that in the illustrations, Vectors are represented with arrows. This implies they are a line/ray and not a point? Not sure where they get the direction from. It seems like X,Y, or X,Y,Z would just give you a solitary point, not an arrow. Could you explain this?

@HauntedHotPocket: Don't forget to upvote helpful answers, and to mark successful answers as accepted. I've taken the liberty of doing that for you, here. :)

Is it always assuming the vector is calculated from your current position (0,0), or (0,0,0)? Sorry for the noobery.