Coding a wheel, that rotates when "touched"

Hi,

I could need some help, some initial pointers, where to look at.

I want to code a wheel, attached to the background that rotates when when the user touches it (in the end the wheel spins faster, when the user applies more “force” to it).

so my first hint I need is: how to attach the wheel to the background. I thought about joints, but I am not sure which one to take.

Any hints?

Thanks
Criamon [import]uid: 28916 topic_id: 7480 reply_id: 307480[/import]

ui,

the first step was easy. I just draw a small circle and connected my wheel with a pivot joint to it. When I apply a linear impuls the wheel rotates - cool :slight_smile:

next step. This seems to be more difficult. I added a second wheel next to my first one. When I apply an impuls to the first wheel the new wheel should spin due to friction from the first wheel. How can I simulate this? second wheel does not spin at the moment

thanks criamon [import]uid: 28916 topic_id: 7480 reply_id: 26480[/import]

Hi could you tell me how you managed to make the wheel slow down after you applied impulse?

function onTouch (event)

if event.phase==“began” then

elseif event.phase ==“moved” then
circle:applyLinearImpulse(10)
elseif event.phase==“ended” then

circle:applyForce(-100,400, 700)

That doesnt seem to slow it down but makes it go faster [import]uid: 43191 topic_id: 7480 reply_id: 27090[/import]

wheel2.angularDamping = 0.5

that did it

Criamon [import]uid: 28916 topic_id: 7480 reply_id: 27094[/import]

You are a STAR !!! :smiley: [import]uid: 43191 topic_id: 7480 reply_id: 27099[/import]