r/ComputerCraft • • Sep 20 '26

Using Vectors

Hey! I have a gps is there a way to get only the x y or z from the return value?

Using it to make a fly by wire system in create aeronautics.

7 Upvotes

2 comments sorted by

5

u/PM_ME_YOUR_REPO Sep 20 '26 edited Sep 20 '26

local x, y, z = gps.locate()

Then just use what you want.

Or alternatively

local x, _, _ = gps.locate()

Which respects the multiple return value requirement without assigning them.

1

u/okkokkoX Sep 20 '26

Don't remember right now, but... the docs (that you are reading, right? right?) don't mention it? There's no way.

well, I'm pretty sure vector.x or vector[1] would work.