Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
queryAABB coming up with error — Gideros Forum

queryAABB coming up with error

ZizanymanZizanyman Member
edited December 2014 in General questions
In my game you have to draw a line as close to a wall as you can, so I decided to use queryAABB. However, it comes up with this error:

main.lua:104: calling 'queryAABB' on bad self (b2World expected, got table)
stack traceback:
main.lua:104: in function


Here is my code (I am using "place" instead of "scene" for the event listener):

101. local function lineclose(event)
102. x1 = event.x
103. y1 = event.y
104. local fixtures = b2.World:queryAABB(x1-15,y1-15,x1+15,y1+15)
105. if fixtures > 0 then
106. print ("yes")
107. end
108. end
109. place:addEventListener(Event.MOUSE_UP, lineclose)

Anyone know why this is happening? Thanks! :)>-

Comments

Sign In or Register to comment.