Reseting linearVelocity?

Can some please tell you how you wuld go about resetting the velocity of a physics.body?

Not exactly sure what you’re after, but here is an example to change the linear velocity in the up direction. You can change the 0 to give it a direction left or right if you want to try that… Just tap the screen to change the ball direction.


displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT_ANY)

function setup()
    c1=physics.body(CIRCLE,20)
    c1.x=WIDTH/2
    c1.y=900
end

function draw()
    background(40, 40, 50)
    text("tap screen to raise ball",WIDTH/2,HEIGHT-100)
    fill(255)
    ellipse(c1.x,c1.y,40)
end

function touched(t)
    if t.state==BEGAN then
        c1.linearVelocity=vec2(0,100) --change velocity in up direction
    end
end

Thats what I was looking for thanks.