I'm making a physics-based game in which I need to know the direction the body is facing towards. Getting the value should be easy with b2.body:getAngle, but unfortunately I'm getting an error when trying to do so.
This is what I have: local angle = self.ball:getAngle()
And this is the error I get when trying to run my code: attempt to call method 'getAngle' (a nil value)
self.ball:getY() works just fine in the same project.
I couldn't find any examples or tutorials using getAngle. Does anybody know what I might be doing wrong?
Thanks in advance.
Comments
Here is a list of some box2d tutorials:
http://giderosmobile.com/forum/discussion/comment/9141#Comment_9141
Likes: Karriz