Wheel bodies stopped colliding with car in my project. I throroughly checked every char in the code, nothing worked.
Since I’m noobie, I tried the Corona University tutorial.
It worked in the beginning, then… suddenly the wheels were not colliding anymore.
I closed the project, the Corona Simulator, deleted sandbox and even rebooted my computer.
Nothing worked.
I started a new project with only main.lua (it’s the coronaU tutorial code):
local physics = require( "physics") physics.start( ) physics.setGravity( 0, 9.8 ) physics.setDrawMode( "hybrid" ) local joints = {} local vehicleBody = display.newRect( 10, 10, 100, 20 ) physics.addBody( vehicleBody) vehicleBody.x, vehicleBody.y = display.contentCenterX, display.contentHeight - 120 vehicleBody.isFixedRotation = true local wheelParams = { bounce = 0, friction = 1, radius = 20 } local wheelA = display.newCircle( 0, 0, 20 ) physics.addBody( wheelA, wheelParams ) wheelA.x, wheelA.y = vehicleBody.x - 25, vehicleBody.y + 30 local wheelB = display.newCircle( 0, 0, 20 ) physics.addBody( wheelB, wheelParams ) wheelB.x, wheelB.y = vehicleBody.x + 25, vehicleBody.y + 30 local wheelSpringFrequency = 20 local wheelSpringDampingRatio = 0.8 joints[#joints + 1] = physics.newJoint( "wheel", vehicleBody, wheelA, wheelA.x, wheelA.y, 0, 1 ) joints[#joints].springFrequency = wheelSpringFrequency joints[#joints].springDampingRatio = wheelSpringDampingRatio joints[#joints + 1] = physics.newJoint( "wheel", vehicleBody, wheelB, wheelB.x, wheelB.y, 0, 1 ) local ground = display.newRect( 0, 0, display.contentWidth, 80 ) physics.addBody( ground, "static", {bounce = 0, friction = 1} ) ground.x, ground.y = display.contentCenterX, display.contentHeight - ground.contentHeight/2 wheelA:applyTorque( 2.8 ) wheelB:applyTorque( 2.8 )
~
Can anyone confirm that the wheels are not colliding!?!? Any idea why!?
Thanks.
