Koregan Posted May 27, 2015 Share Posted May 27, 2015 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 More sharing options...
Fuji Posted May 27, 2015 Share Posted May 27, 2015 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 More sharing options...
EasyPickins Posted May 27, 2015 Share Posted May 27, 2015 The Vector2 class isn't exposed to Lua at the moment. I'll change it so it is. Koregan 1 Link to comment Share on other sites More sharing options...
Koregan Posted May 27, 2015 Author Share Posted May 27, 2015 :D Thanks a lot, EasyPickins :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 More sharing options...
EasyPickins Posted May 28, 2015 Share Posted May 28, 2015 Vector2:getDirection() Koregan 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now