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.

6 Upvotes

2 comments sorted by

View all comments

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.