Jump to content

Handle a Vector2


Koregan

Recommended Posts

I have a problem handling the "player:getAngle()"-function,

 

print(player:getAngle() ) shows a string like:

Vector2 (X: 0,000000, Y: -1,000000) (L: 1,000000, D:3,141593)

 

Can anyone tell me how I get D (the direction of the Vector2) ?

 

 

To be honest, before build 32, I was able to get this string with player:getAngle():toString() and then just extracted the value of D out of the string.

 

But now with build 32 this is not working any more.

Seens like toString() doesn't exist in this function/method/... any more.

 

I am stuck at this point.

 

Some help would be nice... (Thanks)

Link to comment
Share on other sites

toString should work for anything going through java/kahlua, but as far as I know, it should be toString(player.getAngle())

Edit: Apparently toString is a native lua method, but its still used the same way.

Link to comment
Share on other sites

:D :D :D  Thanks a lot, EasyPickins :D :D :D

 

--------------------------------------------------------------------------

 

But how can I grab the direction D then?

player:getAngle():getD() ?

 

If someone knows, please tell me.

Otherwise i will have to test and find out on my own...

Link to comment
Share on other sites

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
×
×
  • Create New...