From ComputerCraft⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Colon notation: self:add(
Given two vectors, self and object, this function will add the object to self to create a new vector. This can also be written as
self + object. If either argument was not created with vector.new, this function will not work as designed.
|Creates two new vectors then adds them together.|
local vectorA = vector.new(240, 71, -3040) local vectorB = vector.new(2553, 32, -314) local vectorC = vector.add(vectorA, vectorB) print("My new vector has the components:", vectorC.x, vectorC.y, vectorC.z)
|Output||My new vector has the components: 2793 103 -3354|
Retrieved from "https://wiki.computercraft.cc/index.php?title=Vector.add&oldid=4083"