Jump to content

vector to table


Mr.Loki

Recommended Posts

Posted

Hello, I'm using vectors and im wondering if there is a better way of changing a vector into a table?

This is what I'm currently doing because i want to use the unpack() function.
 

pos = localPlayer.position

T = {pos.x,pos.y,pos.z}

 

Posted (edited)

No.

What I do recommend is to make a method for that (instead of doing it always by hand) by extending the Vector3 class.

function Vector3:unpack( )
    return { self.x, self.y, self.z }
end

 

Edited by myonlake
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...