Rotate tire

physics.addBody(leftTire, "dynamic", {density=15, friction=1, bounce=.5, radius=30}) physics.addBody(rightTire, "dynamic", {density=15, friction=1, bounce=.5, radius=30}) physics.addBody(truck, physicsData:get("truck") ) leftTireJoint = physics.newJoint("wheel", truck, leftTire, leftTire.x, leftTire.y, 0, 50) rightTireJoint = physics.newJoint("wheel", truck, rightTire, rightTire.x, rightTire.y, 0, 50) leftTireJoint.isMotorEnabled = true leftTireJoint.motorSpeed = 5000000 

I created a truck and 2 tires. The tires use a wheel joint and everything seems to look and work correctly as far as the joints. However no matter what I do I can’t get the wheels to spin using the motorSpeed. If I set the truck on an incline it will roll just fine but I can’t seem to power it. Any ideas?

Thanks

Small search and voila: http://developer.coronalabs.com/code/billy-cart-corona

The wheel joint motor is for the piston part of the joint, not the wheel rotation.

If you want to rotate the wheel then you can use applyTorque or applyAngularImpulse to the leftTire

I know you’re trying to help but I searched for probably 4 hours or so before posting this thread. I not only seen this example but quite a few others. I tried for hours to make my code work based on the examples I found online. That’s why I posted here so hopefully someone can give me some insight on why my code isn’t working.

  

This is exactly what I needed thanks. After you saying that it makes perfect sense that the joint isn’t what is controlling the wheel it’s just what’s holding the wheel. The “wheel” joint is what confused me. Thanks again for your help.

Small search and voila: http://developer.coronalabs.com/code/billy-cart-corona

The wheel joint motor is for the piston part of the joint, not the wheel rotation.

If you want to rotate the wheel then you can use applyTorque or applyAngularImpulse to the leftTire

I know you’re trying to help but I searched for probably 4 hours or so before posting this thread. I not only seen this example but quite a few others. I tried for hours to make my code work based on the examples I found online. That’s why I posted here so hopefully someone can give me some insight on why my code isn’t working.

  

This is exactly what I needed thanks. After you saying that it makes perfect sense that the joint isn’t what is controlling the wheel it’s just what’s holding the wheel. The “wheel” joint is what confused me. Thanks again for your help.